Equivalent android.content.BroadcastReceiver in Swift

偶尔善良 提交于 2020-02-21 10:12:51

问题


I would like to know if there is an equivalent android.content.BroadcastReceiver in Swift. I would need the same handler like onReceive(Context context, Intent intent)

It is possible ?

Thank you

Ysee


回答1:


In Swift in order to achieve the same effect you would use the NSNotificationCenter. Take a look at this link below for some guidance

http://www.andrewcbancroft.com/2014/10/08/fundamentals-of-nsnotificationcenter-in-swift/



来源:https://stackoverflow.com/questions/30397163/equivalent-android-content-broadcastreceiver-in-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!