这个问题最好被删除,因为它只与过时的 Xcode 测试版有关。
[WWDC Video 721 Combine in Practice][1] 似乎表明 RunLoop.main 应该是在 Combine with delay
or中使用的有效调度程序,debounce
但我看到 Xcode 的编译错误声称 RunLoop 不符合调度程序。我做错了什么还是这只是 Xcode 的第一个测试版的问题。
ContentView.swift:95:77: error: argument type 'RunLoop' does not conform to expected type 'Scheduler'
return delayPublisher.debounce(for: .seconds(5), scheduler: RunLoop.main).eraseToAnyPublisher()
我已经提出了 FB6160439。
[1]:https ://developer.apple.com/videos/play/wwdc2019/721/ (幻灯片 79、80、211)。