Created
January 17, 2016 02:28
-
-
Save tdtsh/3a443bbc7192292ecc0a to your computer and use it in GitHub Desktop.
Swift2 で NavigationBar の 右にボタンを複数追加
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
super.viewDidLoad() | |
// ボタン達 | |
let addButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Add, target: self, action: "insertNewObject:") | |
let cameraButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Camera, target: self, action: "insertNewObject:") | |
let myRightButtons = [addButton, cameraButton] | |
// テンプレはこうだった | |
//self.navigationItem.rightBarButtonItem = addButton | |
// 右ボタン複数配置 | |
self.navigationItem.setRightBarButtonItems(myRightButtons, animated: true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment