I can create a CALayer
using [CALayer layer]
and then have rounded corners using layer.cornerRadius = x
.
After I do this, I have a rounded rectangle layer. Is it possible for me to extract this rounded rectangle outline as a path without re-creating the path myself?
If you just want the path then surely it's easy enough to just make one?
UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:layer.bounds
cornerRadius:layer.cornerRadius];
If you need to use this in CoreGraphics
then just ask for it's CGPath
roundedRect.CGPath;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With