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.
我必须像这样在我的项目中使用 ReplaySubject:
let myVariable = ReplaySubject<[MyItems]>.create(bufferSize: myBufferSize)
如何获取“MyItems”数组中的项目数?
只需将数组映射到其计数:
let countObservable = myVariable.map { $0.count }