subscribe

作者: 曾柏超 | 来源:发表于2018-02-01 10:56 被阅读0次
    
    let subject = PublishSubject<Int>()
            subject.subscribe({ (event) in
                print("Event:\(event)")
            })
    
            subject.onNext(1)
            subject.onNext(2)
            subject.onCompleted()
    
    //Event:next(1)
    //Event:next(2)
    //Event:completed
    
    
    
    
    

    相关文章

      网友评论

          本文标题:subscribe

          本文链接:https://www.haomeiwen.com/subject/zlxdzxtx.html