How to do number keypad with done button in Swift 2.0?
问题 I've tried lots of numeric keyboard with done button, it's not found a correct answer in SWIFT 2.0. 回答1: You can add done button above keyboard using toolbar override func viewDidLoad() { super.viewDidLoad() let tooBar: UIToolbar = UIToolbar() tooBar.barStyle = UIBarStyle.BlackTranslucent tooBar.items=[ UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: self, action: nil), UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Done, target: self, action: