gpt4 book ai didi

ios - 如何在 RxSwift 中使用 CLLocation 扩展

转载 作者:可可西里 更新时间:2023-11-01 05:40:16 26 4
gpt4 key购买 nike

我想将 CLLocationManagerRxSwift 一起使用,就像在
https://github.com/ReactiveX/RxSwift/issues/413 中一样
但我发现 CLLocationManager 扩展被移到了 RxExample
(这里提到 https://github.com/ReactiveX/RxSwift/issues/900 )。

我的问题是:如何使用该代码?当我导入 RxSwiftRxCocoa 时,我无法访问例如locationManager.rx.didUpdateLocations。我应该怎么做才能将 CoreLocationRxSwift 一起使用?

我正在使用 Xcode 8、Swift 3。

在此先感谢您的帮助!

更新

我发现建议现在我们必须从 RxExample 复制并粘贴 CLLocationManager 扩展(详细信息 here 在该提交的评论中)。

最佳答案

您必须将扩展 CLLocationManager+Rx.swift 和 RxCLLocationManagerDelegateProxy.swift 复制到您的项目中,因为它不再是 RxCocoa 的一部分

关于ios - 如何在 RxSwift 中使用 CLLocation 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40811273/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com