1

I am coding in Swift. And I am writing a Mac OS app. I have created an NSBezierPath, now I want to add it my layer (CALayer)? How do you do that?

        let myShape = NSBezierPath()
        myShape.appendBezierPathWithArcWithCenter(centrePoint, radius: 150, startAngle: CGFloat(270.0 + CGFloat(testTasksArr.indexOf(task)! + 1)), endAngle: CGFloat(270.0 + CGFloat(testTasksArr.indexOf(task)! + 1) + CGFloat(360/testTasksArr.count)), clockwise: true)
        myButtonLayer.path = myShape

The last line doesn't work, as value of type CALayer has no member path

Anna-Lischen
  • 856
  • 1
  • 16
  • 35

0 Answers0