shannoga
shannoga

Reputation: 19869

Calculate UIBezierPath width and height?

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

Answers (3)

andrewchan2022
andrewchan2022

Reputation: 5290

in swift 4:

myPath.cgPath.boundingBox.width
myPath.cgPath.boundingBox.height

Upvotes: 4

Tanner Silva
Tanner Silva

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

Bartosz Ciechanowski
Bartosz Ciechanowski

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

Related Questions