If I understand correctly, what you're trying to do is creating views that look like the following:
Note that the areas are not rectangular, so they cannot be view frames. They are shapes that can be created via CGPath functions.
An easy way to create those lines is with CGPathAddLineToPoint
. Always add a line that starts at the center of the view and goes down far the y coordinate. All you have to do is change the CGAffineTransform *m
parameter by calling repeatedly CGAffineTransformRotate
with an angle = 2*pi/n
where n is the number of equal parts.
Assuming you have a CGAffineTransform t
and the aforementioned angle, you'd loop n times:
CGPathRef path = CGPathCreateMutable();
CGPathAddLineToPoint(path, CGAffineTransformRotate(t,angle), view.frame.center.x, view.frame.center.y + view.frame.size.y);
// Now do something with that line....