Post

Replies

Boosts

Views

Activity

Reply to override var navigationItem: UINavigationItem fail in iOS 14
@andyl_ From Apple's own documentation on UIViewController.navigationItem property (https://developer.apple.com/documentation/uikit/uiviewcontroller/1621851-navigationitem): "... To ensure the navigation item is configured, you can either override this property and add code to create the bar button items when first accessed or create the items in your view controller's initialization code. ..." "... Avoid tying the creation of bar button items in your navigation item to the creation of your view controller's view.  ..." So I really don't understand what is wrong with @pkiman's code above. Although I'm also encountering an infinite loop sometimes, but on other projects similar code works just fine. Can't get what is going on there to be honest...
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’22