I’m trying to reposition my UIBarButtonItem so that it sits with it’s edges against the top and right of the UINavigationBar. I found this accepted answer on how to do this, but I don’t really understand how to code it.
I’ve started by creating a new class called CustomNavBar which inherits from UINavigationBar. I then placed this method in the implementation:
- (void) layoutSubviews
{
}
What I don’t understand is the part in the answer that says
call [super layoutSubviews] and then find and reposition the button's view.
How do I code this? Even a nudge in the right direction would be helpful. Thanks!
Find the button you want to move after you call
layoutSubviewsbecause it will be repositioned to where iOS wants it to be every timelayoutSubviewsis called.