无法为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 }
Run Code Online (Sandbox Code Playgroud)
错误信息:
“无法将类型为'Double'的值转换为预期的参数类型'RxTimeInterval'(aka'DispatchTimeInterval')”