Question

One of those things that is probably trivial when you know the magic, which I don't. I want to know the x,y location and dimensions of the UIToolbar at the bottom of my iPhone screen (so that I can make sure whatever I do in the window above it, which is a video preview window, doesn't over lap the toolbar). But toolbars don't have a frame, so what to do?

I create the toolbar in the Storyboard and then drag a line over to .h file which creates this:

@property (retain, nonatomic) IBOutletCollection(UIToolbar) NSArray *mainToolBar;

So how do I go from this NSArray to something with a frame? Please note that I want this information on the toolbar itself, not the buttons within.

Thank you very much.

PS - I recognize that the toolbar is below the preview window and so it doesn't strictly apply in this case, but I'd like to know the answer for other cases.

Was it helpful?

Solution

Create your outlet from here

enter image description here

Instead of creating from

enter image description here

And access your frame property

float y =  self.toolbar.frame.origin.y; like this
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top