I need to draw an outline for a rounded rectangle. I know I can make lines and arcs, but maybe there is also a function for rounded rects?
Swift 4.2
let lineWidth: CGFloat = 5.0 let path = UIBezierPath(roundedRect: rect.insetBy(dx: lineWidth/2.0, dy: lineWidth/2.0), cornerRadius: 10。0) path.lineWidth = lineWidth UIColor.green.setStroke() path.stroke()