penso nulla di quanto sopra è andare a lavorare
Prova questo
var burgerItem = UIBarButtonItem(image: UIImage(named:"categories"), style: .Plain, target: self, action: "categories")
var weatherItem = UIBarButtonItem(title: "Weather", style: .Plain, target: self, action: "weather")
burgerItem.tintColor = UIColor.whiteColor()
weatherItem.tintColor = UIColor.whiteColor()
navigationItem.setRightBarButtonItems([burgerItem,weatherItem], animated: true)
Devi usare navigationItem.setRightBarButtonItems e fate attenzione. navigationItem deve essere di un controller di visualizzazione.
class testViewController:UIViewController {
ovverride func viewDidLoad() {
self.navigationItem.setRightBarButtonItems(...
}
}
fonte
2015-05-20 06:51:52
possibile duplicato di [Come aggiungere 2 pulsanti nella UINavigationBar sul lato destro, senza IB?] (Http://stackoverflow.com/questions/1803609/ how-to-add-2-buttons-in-the-uinavigationbar-on-the-right-side-without-ib) –