[英]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
.当我导入
RxSwift
和RxCocoa
我无法访问例如locationManager.rx.didUpdateLocations
。 What should I do so that I can use CoreLocation
with RxSwift
?我应该怎么做才能将
CoreLocation
与RxSwift
CoreLocation
使用?
I'm using Xcode 8, Swift 3.我正在使用 Xcode 8、Swift 3。
Thanks in advance for your help!在此先感谢您的帮助!
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.