I'm working with swift 2.2 and I'm dealing with such problem: I have an array of UIBezier objects and I need to create a stroke for them as one path.
I used to have a special function for that, but the pros of that approach, that it created several layers. That goes along with my requirements, as I need one layer
func createStroke(line: UIBezierPath) {
self.currentPath = CAShapeLayer()
currentPath.path = line.CGPath
currentPath.strokeColor = UIColor.blackColor().CGColor
currentPath.fillColor = UIColor.clearColor().CGColor
currentPath.lineWidth = 1
self.view.layer.addSublayer(currentPath)
}
What is the best way to create a multiple path from an array of my Bezier lines? The first idea is to create a for-loop cycle, but I consider it is not a clean way.