【发布时间】:2019-06-08 13:21:47
【问题描述】:
无法在 rxswift 中设置去抖动的 Rxtimeinterval。我的代码如下。我收到此错误消息“无法将 'Double' 类型的值转换为预期的参数类型 'RxTimeInterval' (aka 'DispatchTimeInterval')”
searchBar
.rx.text // Observable property thanks to RxCocoa
.orEmpty // Make it non-optional
.debounce(0.5, scheduler: MainScheduler.instance) // Wait 0.5 for changes.
.distinctUntilChanged() // If they didn't occur, check if the new value is the same as old.
.filter { !$0.isEmpty }
错误信息:
“无法将“Double”类型的值转换为预期的参数类型“RxTimeInterval”(又名“DispatchTimeInterval”)”
【问题讨论】: