You can set the property barPosition to UIBarPositionTopAttached another way!
- Add a delegate to your UINavigationBar.
-
Implement
-positionForBar:in the delegate class:- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar { return UIBarPositionTopAttached; }
Your navigation bar’s top must also be anchored to the Top Layout Guide.