请问老师为何测试的时候键盘不见了
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var yearofbirth: UITextField!
@IBOutlet weak var image: UIImageView!
let offset = 4
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func okTapped(sender: AnyObject) {
yearofbirth.resignFirstResponder()
if let year = yearofbirth.text.toInt(){
var imageNumber = (year - offset) % 12
image.image = UIImage(named: String(imageNumber))
}
else {
// notify the user
}
}
}