简体   繁体   中英

How to use CLLocation extension in RxSwift

I want to use CLLocationManager with RxSwift like in
https://github.com/ReactiveX/RxSwift/issues/413
but I found that CLLocationManager extension was moved to RxExample
(mentioned here 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 . What should I do so that I can use CoreLocation with RxSwift ?

I'm using 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).

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

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

https://github.com/RxSwiftCommunity/RxCoreLocation isn't updated. can't even move the sample code in the readme.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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