Before I push this second view controller I remove the first view controller as an observer:
Maybe that is not what is happening. In fact, it seems to me that it is impossible that viewWillDisappear
comes before pushing.
I am not sure but when you push a new view controller and the keyboard comes up right away, maybe the notification is fired before the other view did disappear.
You could try removing the observer when you initiated the push (e.g. in prepareForSegue
).