Reputation: 59
When I create a UIBarButton programatically in the viewDidLoad() method it does not show up when I run the program. I am not sure what is happening. Sorry I am new to xcode and do not understand how everything works.
var menuButton: UIBarButtonItem = UIBarButtonItem()
override func viewDidLoad() {
super.viewDidLoad()
// creating the refresh control object
menuButton = UIBarButtonItem.init(title: "Menu", style: .plain, target: self, action: nil)
}
It should create a UIBarButton in the navigation controller, instead there is nothing there.
Upvotes: 0
Views: 33