NSNotificationCenter 系统通知

1. UIDevice:

  • UIDeviceOrientationDidChangeNotification // 设备旋转
  • UIDeviceBatteryStateDidChangeNotification // 电池状态改变
  • UIDeviceBatteryLevelDidChangeNotification // 电池电量改变
  • UIDeviceProximityStateDidChangeNotification // 近距离传感器(比如设备贴近了使用者的脸部)
2. keyborard:
  • UIKeyboardWillShowNotification  //将要弹出键盘
  • UIKeyboardDidShowNotification  //显示键盘
  • UIKeyboardWillHideNotification  //将要隐藏键盘
  • UIKeyboardDidHideNotification //键盘已经隐藏
  • UIKeyboardWillChangeFrameNotification  //键盘将要改变frame
  • UIKeyboardDidChangeFrameNotification//键盘已经改变frame
  • UIKeyboardFrameBeginUserInfoKey //键盘刚开始的frame
  • UIKeyboardFrameEndUserInfoKey //键盘最终的frame(动画执行完毕后)
  • UIKeyboardAnimationDurationUserInfoKey //键盘动画的时间
  • UIKeyboardAnimationCurveUserInfoKey //键盘动画的执行节奏(快慢)

3. window:

  • UIWindowDidBecomeVisibleNotification//窗口可见
  • UIWindowDidBecomeHiddenNotification//窗口隐藏
  • UIWindowDidBecomeKeyNotification
  • UIWindowDidResignKeyNotification

4. Application:

  • UIApplicationDidBecomeActiveNotification//程序从后台激活
  • UIApplicationDidChangeStatusBarFrameNotification//状态栏frame改变
  • UIApplicationDidChangeStatusBarOrientationNotification//状态栏方向改变
  • UIApplicationDidEnterBackgroundNotification//进入后台
  • UIApplicationDidFinishLaunchingNotification//程序加载完成
  • UIApplicationDidReceiveMemoryWarningNotification//内存警告
  • UIApplicationProtectedDataDidBecomeAvailable
  • UIApplicationProtectedDataWillBecomeUnavailable
  • UIApplicationSignificantTimeChangeNotification//重要的时间变化(新的一天开始或时区变化)
  • UIApplicationWillChangeStatusBarOrientationNotification//将要改变状态栏方向
  • UIApplicationWillChangeStatusBarFrameNotification//将要改变状态栏frame
  • UIApplicationWillEnterForegroundNotification
  • UIApplicationWillResignActiveNotification
  • UIApplicationWillTerminateNotification
5. Media:
  • MPMediaLibraryDidChangeNotification
  • MPMusicPlayerControllerPlaybackStateDidChangeNotification
  • MPMusicPlayerControllerNowPlayingItemDidChangeNotification
  • MPMusicPlayerControllerVolumeDidChangeNotification

6. others:

  • NSUserDefaultsDidChangeNotification//用户默认设置变化
  • NSCurrentLocaleDidChangeNotification//本地化语言变化

 

posted @ 2018-11-28 16:22  CindyLi  阅读(96)  评论(0)    收藏  举报