UIDevice
UIDeviceOrientationDidChangeNotification:设备旋转
UIDeviceBatteryStateDidChangeNotification:电池状态改变
UIDeviceBatteryLevelDidChangeNotification:电池电量改变
UIDeviceProximityStateDidChangeNotification:近距离传感器(比如设备贴近了使用者的脸部)
键盘通知
UIKeyboardWillShowNotification:键盘即将显示
UIKeyboardDidShowNotification:键盘显示完毕
UIKeyboardWillHideNotification:键盘即将隐藏
UIKeyboardDidHideNotification:键盘隐藏完毕
UIKeyboardWillChangeFrameNotification:键盘的位置尺寸即将发生改变
UIKeyboardDidChangeFrameNotification:键盘的位置尺寸改变完毕
系统发出键盘通知时,会附带一些跟键盘有关的额外信息(字典),字典常见的key如下:
UIKeyboardFrameBeginUserInfoKey:键盘刚开始的frame
UIKeyboardFrameEndUserInfoKey:键盘最终的frame(动画执行完毕后)
UIKeyboardAnimationDurationUserInfoKey:键盘动画的时间
UIKeyboardAnimationCurveUserInfoKey:键盘动画的执行节奏(快慢)
程序相关
UIApplicationDidEnterBackgroundNotification:当程序被推送到后台时
UIApplicationWillEnterForegroundNotification:当程序从后台将要重新回到前台时
UIApplicationDidFinishLaunchingNotification:当程序完成载入后通知
UIApplicationDidBecomeActiveNotification:应用程序转为激活状态时
UIApplicationWillResignActiveNotification 用户按下主屏幕按钮调用通知,并未进入后台状态
UIApplicationDidReceiveMemoryWarningNotification:内存较低时通知
UIApplicationWillTerminateNotification:当程序将要退出时通知
UIApplicationSignificantTimeChangeNotification:当系统时间发生改变时通知
UIApplicationBackgroundRefreshStatusDidChangeNotification:后台下载状态发生改变时通知(iOS7.0以后可用)
UIApplicationUserDidTakeScreenshotNotification:截屏通知
UIApplicationDidChangeStatusBarFrameNotification:状态栏frame改变
UIApplicationDidChangeStatusBarOrientationNotification:状态栏方向改变
UIApplicationProtectedDataDidBecomeAvailable:当受保护的文件可供代码访问时发布
UIApplicationProtectedDataWillBecomeUnavailable:在受保护的文件被锁定并无法访问之前不久发布
UIApplicationWillChangeStatusBarOrientationNotification:当应用程序即将更改其界面方向时发布
UIApplicationWillChangeStatusBarFrameNotification:当应用程序将要更改状态栏的框架时发布
窗口
UIWindowDidBecomeVisibleNotification:窗口可见
UIWindowDidBecomeHiddenNotification:窗口隐藏
UIWindowDidBecomeKeyNotification:当UIWindow对象成为关键窗口时发布
UIWindowDidResignKeyNotification:当UIWindow对象不是关键窗口时发布
音视频
MPMediaLibraryDidChangeNotification:指示媒体库已更改
MPMusicPlayerControllerPlaybackStateDidChangeNotification:以编程方式或用户操作更改播放状态时发布
MPMusicPlayerControllerNowPlayingItemDidChangeNotification:在当前播放的媒体项发生更改时发布
MPMusicPlayerControllerVolumeDidChangeNotification:当音乐播放器的音频播放音量改变时发布
其他
NSUserDefaultsDidChangeNotification:用户默认设置变化
NSCurrentLocaleDidChangeNotification:本地化语言变化
网友评论