iOS8 Extension中横竖屏Notification问题

问题描述:输入法Extension中使用Notification监听UIApplicationDidChangeStatusBarOrientationNotification,发现userInfo中返回转屏前方向

问题分析:使用self.interfaceOrientation发现同样返回的是转屏前方向。查了下文档,发现:

UIApplicationWillChangeStatusBarOrientationNotification
Posted when the app is about to change the orientation of its interface.

UIApplicationDidChangeStatusBarOrientationNotification
Posted when the orientation of the app’s user interface changes.

问题解决:替换为UIApplicationWillChangeStatusBarOrientationNotification监听事件,返回正常

PS:Xcode6 beta5, iOS8 ,Keyboard Extension