1. 程式人生 > >iOS的一些常見系統Notification(系統訊息)

iOS的一些常見系統Notification(系統訊息)

一、鍵盤 

1、UIKeyboardWillShowNotification-將要彈出鍵盤 
2、UIKeyboardDidShowNotification-顯示鍵盤 
3、UIKeyboardWillHideNotification-將要隱藏鍵盤 
4、UIKeyboardDidHideNotification-鍵盤已經隱藏 
5、UIKeyboardWillChangeFrameNotification-鍵盤將要改變frame 
6、UIKeyboardDidChangeFrameNotification-鍵盤已經改變frame

二、視窗 

1、UIWindowDidBecomeVisibleNotification-視窗可見 
2、UIWindowDidBecomeHiddenNotification-視窗隱藏 
3、UIWindowDidBecomeKeyNotification 
4、UIWindowDidResignKeyNotification 

三、程式訊息 

1、UIApplicationDidBecomeActiveNotification-程式從後臺啟用 
2、UIApplicationDidChangeStatusBarFrameNotification-狀態列frame改變 
3、UIApplicationDidChangeStatusBarOrientationNotification-狀態列方向改變 
4、UIApplicationDidEnterBackgroundNotification-進入後臺 
5、UIApplicationDidFinishLaunchingNotification-程式載入完成 
6、UIApplicationDidReceiveMemoryWarningNotification-記憶體警告 
7、UIApplicationProtectedDataDidBecomeAvailable 
8、UIApplicationProtectedDataWillBecomeUnavailable 
9、UIApplicationSignificantTimeChangeNotification 重要的時間變化(新的一天開始或時區變化) 
10、UIApplicationWillChangeStatusBarOrientationNotification-將要改變狀態列方向 
11、UIApplicationWillChangeStatusBarFrameNotification-將要改變狀態列frame 
12、UIApplicationWillEnterForegroundNotification 
13、UIApplicationWillResignActiveNotification 
14、UIApplicationWillTerminateNotification


四、電池、方向、感測器 

1、UIDeviceBatteryLevelDidChangeNotification //電池電量 
2、UIDeviceBatteryStateDidChangeNotification //電池狀態 
3、UIDeviceOrientationDidChangeNotification //方向 
4、UIDeviceProximityStateDidChangeNotification //近距離感測器

五、音視訊 

1、MPMediaLibraryDidChangeNotification 
2、MPMusicPlayerControllerPlaybackStateDidChangeNotification 
3、MPMusicPlayerControllerNowPlayingItemDidChangeNotification 
4、MPMusicPlayerControllerVolumeDidChangeNotification

六、其他 

1、NSUserDefaultsDidChangeNotification 使用者預設設定變化 
2、NSCurrentLocaleDidChangeNotification 本地化語言變化