I have added observers so that I can move textFields above keyboard.
Its working fine on all devices but keyboardWillAppear
function is not called when running in simulator iPhone 4S (iOS 9).
This is happening when I "Connect Hardware Keyboard"
keyboardWillHide
is being called instead of keyboardWillShow
override func viewDidLoad() {
super.viewDidLoad()
NSNotificationCenter.defaultCenter().addObserver(self, selector:"keyboardWillAppear:", name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector:"keyboardWillDisappear:", name: UIKeyboardWillHideNotification, object: nil)
}
func keyboardWillAppear(notification: NSNotification){
// This is not called on simulator iPhone 4S(iOS 9.0)
}
func keyboardWillDisappear(notification: NSNotification){
// This is called
}
I really can't understand this behaviour. Can someone please explain the internal functionality which leads to this.