Reputation: 19869
I am creating many umorphic UIBezierPaths. I need to calculate the width and the height of a UIBezierPath. How can I do that?
Upvotes: 7
Views: 4951
Reputation: 5290
in swift 4:
myPath.cgPath.boundingBox.width
myPath.cgPath.boundingBox.height
Upvotes: 4
Reputation: 279
You can get the height with the following line of code.
myPath.bounds.size.height;
And for width...
myPath.bounds.size.width;
Upvotes: 14
Reputation: 10333
For eveyrthing related to Bezier curves I can't recommend enough this site, which contains a full chapter related to your problem.
Upvotes: 6