小编Bik*_*jan的帖子

如何在RxSwift中为反跳设置RxTimeInterval?

无法为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')”

xcode ios swift rx-swift

4
推荐指数
2
解决办法
1211
查看次数

标签 统计

ios ×1

rx-swift ×1

swift ×1

xcode ×1