// // RxCLLocationManagerDelegateProxy.swift // RxCocoa // // Created by Carlos García on 8/7/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // import CoreLocation #if !RX_NO_MODULE import RxSwift import RxCocoa #endif class RxCLLocationManagerDelegateProxy : DelegateProxy , CLLocationManagerDelegate , DelegateProxyType { class func currentDelegateFor(_ object: AnyObject) -> AnyObject? { let locationManager: CLLocationManager = object as! CLLocationManager return locationManager.delegate } class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) { let locationManager: CLLocationManager = object as! CLLocationManager locationManager.delegate = delegate as? CLLocationManagerDelegate } }