toiavalle
toiavalle

Reputation: 434

How to use bezierPathWithCGPath Swift

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.

Upvotes: 0

Views: 530

Answers (1)

Undo
Undo

Reputation: 25697

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.

Upvotes: 2

Related Questions