【问题标题】:How to use CLLocation extension in RxSwift如何在 RxSwift 中使用 CLLocation 扩展
【发布时间】:2017-04-10 05:25:00
【问题描述】:

我想在
https://github.com/ReactiveX/RxSwift/issues/413
中使用 CLLocationManagerRxSwift,但我发现 CLLocationManager 扩展名已移至 RxExample
(此处提到 https://github.com/ReactiveX/RxSwift/issues/900)。

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

我正在使用 Xcode 8、Swift 3。

提前感谢您的帮助!

更新

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

【问题讨论】:

    标签: ios swift3 cllocation rx-swift


    【解决方案1】:

    对于通过 Google 找到此内容的任何人,Rx 位置管理器功能已移至:https://github.com/RxSwiftCommunity/RxCoreLocation,因此不再需要手动复制和粘贴文件。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-02-22
        • 1970-01-01
        • 1970-01-01
        • 2016-08-16
        相关资源
        最近更新 更多