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
网友评论