Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 e.g. 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).

like image 902
krlbsk Avatar asked Nov 25 '16 19:11

krlbsk


2 Answers

You have to copy the extension CLLocationManager+Rx.swift and RxCLLocationManagerDelegateProxy.swift to your project as it is no longer part of RxCocoa

like image 114
Daniel Poulsen Avatar answered Sep 30 '22 18:09

Daniel Poulsen


For anyone who finds this through Google, Rx Location Manager functionality has been moved to: https://github.com/RxSwiftCommunity/RxCoreLocation so there is no longer a need to manually copy and paste files.

like image 44
Gantrim Avatar answered Sep 30 '22 19:09

Gantrim