Shklyar
Shklyar

Reputation: 160

UIBarButtonSystemItem Info and Statistics

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

Answers (2)

Piotr Badura
Piotr Badura

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

soumya
soumya

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

Related Questions