Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ReactiveKit 文档说:
我们如何使用这样的主题? 让名称=主题() name.observeNext { name in print("Hi (name)!") }
我们如何使用这样的主题?
让名称=主题()
name.observeNext { name in print("Hi (name)!") }
有没有一种“unobserveNext”方法?
你为什么需要那个?通过调用 dispose 你可以取消订阅。
let dispose = name.observeNext { name in print("Hi (name)!") } dispose.dispose();