Reputation: 566
I have two UIViews
, both of which obviously have CGRects
each. One UIView
fills the screen whereas the other just fills part of it in the middle. I have the CGRect
of the smaller UIView
, but how can I get the CGRect
of the one outside of it - excluding the size of the smaller one so that the background can be dimmed, but not the content of the inner UIView
?
This is what my UIViewController
looks like so you can get a better idea of what I'm trying to do:
I want to dim the outer UIView
, not the inner one - but I don't have the CGRect of the outer one excluding the inner UIView
so I've had to do it the other way around for now.
Upvotes: 0
Views: 190
Reputation: 736
So, it looks to me like the outer view is responsible for drawing your content and the inner view is your selection rectangle right?
If so, then I think you are going to want to draw your content twice when you have this selection mode active. You will:
Or
Upvotes: 0
Reputation: 12036
A CGRect is a square size. If you want to know the outer aria you need to compute 4 CGRects. The top, left, right and bottom space.
Upvotes: 4