我想知道Swift中是否有android.content.BroadcastReceiver的相应等效物。 我需要与onReceive(Context context, Intent intent)
相同的处理程序。
这是可能的吗?
谢谢
Ysee
我想知道Swift中是否有android.content.BroadcastReceiver的相应等效物。 我需要与onReceive(Context context, Intent intent)
相同的处理程序。
这是可能的吗?
谢谢
Ysee
在Swift中,要实现相同的效果,您需要使用NSNotificationCenter
。请查看下面的链接以获取一些指导。
http://www.andrewcbancroft.com/2014/10/08/fundamentals-of-nsnotificationcenter-in-swift/