加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

swift 广播

发布时间:2020-12-14 01:56:24 所属栏目:百科 来源:网络整理
导读:var obj = DictionaryString,String()obj[Consts .Brocast .NotifyOp ] = "222222222222" NSNotificationCenter .defaultCenter ().postNotificationName(Consts .BrocastName .NotifyCome , object: obj) func ReceiveNotification(){ NSNotificationCenter
var obj = Dictionary<String,String>()
obj[Consts.Brocast.NotifyOp] = "222222222222"
NSNotificationCenter.defaultCenter().
postNotificationName(Consts.BrocastName.NotifyCome,object: obj)
func ReceiveNotification(){     
    NSNotificationCenter.defaultCenter().
name: Consts.BrocastName.NotifyCome,object: nil) 
}

func OnReceive(sender :NSNotification){
     if let info = sender.object as? NSDictionary{
        if let op = info[Consts.Brocast.NotifyOp] 
        as? String{
           let alert:UIAlertView = 
            UIAlertView(title: op,message: "333333",delegate: self,cancelButtonTitle: "ok")
           alert.show()
        }
      }
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读