Building a clip area in a UIView from path objects in its subviews

Posted by hkatz on Stack Overflow See other posts from Stack Overflow or by hkatz
Published on 2010-04-19T23:11:45Z Indexed on 2010/04/19 23:33 UTC
Read the original article Hit count: 480

I'm trying to produce a clipping area in a UIView that's generated from path objects in its subviews. For example, I might have one subview containing a square and another containing a circle. I want to be able to produce a clip in the parent superview that's the union of both these shapes. Can someone explain how to do this? About all I've been able to figure out so far is that:

1 - the superview's drawRect: method is called before its subviews' drawRects are, and
2 - the ContextRef that's accessible in all three instances is the same.

Other than that I'm stumped. Thanks,
Howard

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiview