iOS各種系統通知Name

來源:互聯網
上載者:User

標籤:

當了一次搬運工,原地址:http://blog.csdn.net/db905517804/article/details/50569949

用法:

- (void) viewWillAppear:(BOOL)animated{    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForegroundNotification) name:UIApplicationWillEnterForegroundNotification object:nil];  }      - (void) appWillEnterForegroundNotification{      NSLog(@"trigger event when will enter foreground.");  }  

 

一、鍵盤
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 本地化語言變化

iOS各種系統通知Name

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.