0

I need to make a bezier path, I have the CGPath the only information I found was this:

Declaration
SWIFT

convenience init(CGPath CGPath: CGPath)

the first is written normal, the second in Italics and the third purple in the developers library

How should I use it? Please give me an example.

Community
  • 1
  • 1
toiavalle
  • 414
  • 7
  • 20

1 Answers1

2

If you have a valid CGPath, just do this:

bezier_path = UIBezierPath(CGPath: your_cg_path)

The vast majority of the yWithX type methods from Objective-C were replaced with init methods in Swift. This Apple documentation has more information on the subject.

Undo
  • 25,519
  • 37
  • 106
  • 129