简体   繁体   中英

Get number of items in a ReplaySubject with Array Element

I have to use ReplaySubject in my project like that:

let myVariable = ReplaySubject<[MyItems]>.create(bufferSize: myBufferSize)

How can I get the number of items in the array of "MyItems"?

只需将数组映射到其计数即可:

let countObservable = myVariable.map { $0.count }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM