国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

IOS如何在Host App 與 App Extension 之間發送通知

2019-10-21 18:55:48
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了IOS如何在Host App 與 App Extension 之間發送通知 的相關資料,需要的朋友可以參考下
 

如何從你的一個App發送通知給另一個App? (例:搜狗輸入法下載皮膚完成后使用皮膚) 注:搜狗輸入法是App、而鍵盤是Extension

當你為你的App 添加 App Extension時,如果想在App 發送通知給 Extension或許這篇文章可以幫助你。

了解更多內容

// 發送通知- (void)postNotificaiton {CFNotificationCenterRef notification = CFNotificationCenterGetDarwinNotifyCenter ();CFNotificationCenterPostNotification(notification, CFSTR("<notificaiton name>"), NULL,NULL, YES);} // 接收通知- (void)receiveNotification {CFNotificationCenterRef notification = CFNotificationCenterGetDarwinNotifyCenter (); CFNotificationCenterAddObserver(notification, (__bridge const void *)(self), observerMethod,CFSTR("<notificaiton name>"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); }void observerMethod (CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo){ // Your custom work } // 移除通知- (void)removeNotification{CFNotificationCenterRef notification = CFNotificationCenterGetDarwinNotifyCenter ();CFNotificationCenterRemoveObserver(notification, (__bridge const void *)(self), CFSTR("<notificaiton name>"), NULL);}

以上內容給大家簡單介紹了IOS如何在Host App 與 App Extension 之間發送通知的相關內容,希望對大家有所幫助!



注:相關教程知識閱讀請移步到IOS開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 克拉玛依市| 曲靖市| 日土县| 嘉义市| 南溪县| 南阳市| 舒城县| 洪泽县| 邓州市| 海伦市| 中西区| 深水埗区| 光山县| 奎屯市| 突泉县| 定西市| 丹棱县| 化隆| 巩义市| 天祝| 胶南市| 庆元县| 孟村| 南和县| 汝南县| 昭觉县| 石台县| 静安区| 宜君县| 册亨县| 民丰县| 锡林浩特市| 百色市| 伊通| 临高县| 封开县| 临安市| 农安县| 泾川县| 双鸭山市| 靖西县|