iOS系统通知 作者: rontian 时间: 2018-07-25 分类: iOS 评论 ### 一、键盘 ``` UIKeyboardWillShowNotification-将要弹出键盘 UIKeyboardDidShowNotification-显示键盘 UIKeyboardWillHideNotification-将要隐藏键盘 UIKeyboardDidHideNotification-键盘已经隐藏 UIKeyboardWillChangeFrameNotification-键盘将要改变frame UIKeyboardDidChangeFrameNotification-键盘已经改变frame ``` ### 二、窗口 ``` UIWindowDidBecomeVisibleNotification-窗口可见 UIWindowDidBecomeHiddenNotification-窗口隐藏 UIWindowDidBecomeKeyNotification UIWindowDidResignKeyNotification ``` ### 三、程序消息 ``` UIApplicationDidBecomeActiveNotification-程序从后台激活 UIApplicationDidChangeStatusBarFrameNotification-状态栏frame改变 UIApplicationDidChangeStatusBarOrientationNotification-状态栏方向改变 UIApplicationDidEnterBackgroundNotification-进入后台 UIApplicationDidFinishLaunchingNotification-程序加载完成 UIApplicationDidReceiveMemoryWarningNotification-内存警告 UIApplicationProtectedDataDidBecomeAvailable UIApplicationProtectedDataWillBecomeUnavailable UIApplicationSignificantTimeChangeNotification 重要的时间变化(新的一天开始或时区变化) UIApplicationWillChangeStatusBarOrientationNotification-将要改变状态栏方向 UIApplicationWillChangeStatusBarFrameNotification-将要改变状态栏frame UIApplicationWillEnterForegroundNotification UIApplicationWillResignActiveNotification UIApplicationWillTerminateNotification ``` ### 四、电池、方向、传感器 ``` 1、UIDeviceBatteryLevelDidChangeNotification //电池电量 2、UIDeviceBatteryStateDidChangeNotification //电池状态 3、UIDeviceOrientationDidChangeNotification //方向 4、UIDeviceProximityStateDidChangeNotification //近距离传感器 ``` ### 五、音视频 ``` MPMediaLibraryDidChangeNotification MPMusicPlayerControllerPlaybackStateDidChangeNotification MPMusicPlayerControllerNowPlayingItemDidChangeNotification MPMusicPlayerControllerVolumeDidChangeNotification 六、其他 NSUserDefaultsDidChangeNotification 用户默认设置变化 NSCurrentLocaleDidChangeNotification 本地化语言变化 ```