To make sure the correct previous window is restored as key window, you can now pass a fromWindow parameter to present overlay methods, if the parameter is nil, we traverse the windows stack and make the likeliest candidate the key window. Otherwise the fromWindow is made key again after dismissing it's presented window. Not passing a "presenting" window can cause certain misbehaviour on iOS 8 because UIInputWindowController and it's corresponding window can be on the windows stack and made key when that is not the wanted behaviour.
remove log
Merge remote-tracking branch 'origin/master'