简体   繁体   English

如何在 RxSwift 中使用 CLLocation 扩展

[英]How to use CLLocation extension in RxSwift

I want to use CLLocationManager with RxSwift like in我想在RxSwift中使用CLLocationManager
https://github.com/ReactiveX/RxSwift/issues/413 https://github.com/ReactiveX/RxSwift/issues/413
but I found that CLLocationManager extension was moved to RxExample但我发现CLLocationManager扩展已移至RxExample
(mentioned here https://github.com/ReactiveX/RxSwift/issues/900 ). (这里提到https://github.com/ReactiveX/RxSwift/issues/900 )。

My question is: how to use that code?我的问题是:如何使用该代码? When I import RxSwift and RxCocoa I don't have access to eg locationManager.rx.didUpdateLocations .当我导入RxSwiftRxCocoa我无法访问例如locationManager.rx.didUpdateLocations What should I do so that I can use CoreLocation with RxSwift ?我应该怎么做才能将CoreLocationRxSwift CoreLocation使用?

I'm using Xcode 8, Swift 3.我正在使用 Xcode 8、Swift 3。

Thanks in advance for your help!在此先感谢您的帮助!

Update更新

I found that it is recommended that for now we must just copy & paste CLLocationManager extension from RxExample (details here in comments of that commit).我发现建议现在我们必须从RxExample复制并粘贴CLLocationManager扩展(详细信息该提交的评论中)。

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

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

https://github.com/RxSwiftCommunity/RxCoreLocation isn't updated. https://github.com/RxSwiftCommunity/RxCoreLocation未更新。 can't even move the sample code in the readme.甚至不能移动自述文件中的示例代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM