国产探花免费观看_亚洲丰满少妇自慰呻吟_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開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 榕江县| 阿合奇县| 凤山县| 桃园市| 灵台县| 资兴市| 井陉县| 华坪县| 屏山县| 镇原县| 钦州市| 博爱县| 鹤岗市| 霍山县| 昌图县| 奎屯市| 河源市| 离岛区| 光山县| 丰台区| 双峰县| 太原市| 小金县| 鄂伦春自治旗| 祁门县| 河间市| 聂荣县| 乡宁县| 宜城市| 尖扎县| 龙岩市| 旬邑县| 江华| 兴海县| 云龙县| 陇西县| 屯昌县| 水城县| 乐陵市| 广灵县| 巩义市|