【发布时间】:2020-01-22 22:07:46
【问题描述】:
我有一个 BehaviorSubject 数组。我想通过 id 从这个数组中删除一张照片。
我试过了;
photosViewModel.favoritePhotos
.observeOn(MainScheduler.instance)
.map { photoList in
photoList.filter { $0.id! != self.currentPhoto.id! } //remove currentPhoto
}.bind(to: photosViewModel.favoritePhotos)
.disposed(by: disposeBag)
【问题讨论】:
标签: swift rx-swift behaviorsubject