Reputation: 160
I need two buttons that I can't find: Info button and Stats button for UINavigationBar. Is there a way to find buttons that represent similar things without painting them?
Upvotes: 0
Views: 794
Reputation: 1672
Swift 3 / 4
let infoButton = UIButton(type: .infoDark)
infoButton.addTarget(self, action: #selector(navbarButtonPressed), for: .touchUpInside)
navigationItem.rightBarButtonItems?.append(UIBarButtonItem(customView: infoButton))
Upvotes: 1
Reputation: 3811
Hope this helps you:
//for info button using custom UIButton
UIButton *btn = [UIButton buttonWithType:UIButtonTypeInfoDark];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
For Statistics no such default button is available
Upvotes: 3