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

首頁 > 系統 > iOS > 正文

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

2020-02-19 15:50:08
字體:
來源:轉載
供稿:網友

開發人員在開發過程中都會通過擴展點指定特定的系統功能,比如通知欄擴展、消息擴展、電話簿擴展等等都可以使用到,今天武林技術頻道小編搜羅整理了相關資訊,感興趣的網友們可別錯過那么好的機會哦!

// 發送通知- (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);}

以上內容給大家簡單介紹了教你如何在Host App 與 App Extension 之間發送通知,希望對大家有所幫助,同時也感謝大家繼續支持武林技術頻道!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 靖远县| 通江县| 巴林左旗| 阳东县| 云安县| 太原市| 民权县| 桐梓县| 台山市| 五家渠市| 小金县| 临潭县| 谷城县| 海晏县| 呼图壁县| 右玉县| 宜兴市| 长武县| 长宁区| 招远市| 凤阳县| 双鸭山市| 溧阳市| 龙泉市| 友谊县| 华宁县| 广州市| 高碑店市| 阿荣旗| 和政县| 胶州市| 富平县| 贵州省| 玉门市| 铜川市| 广河县| 交口县| 剑川县| 平湖市| 湄潭县| 比如县|