Name: RxMKMapView
Owner: RxSwift Community
Description: RxMKMapView is a RxSwift wrapper for MKMapView `delegate`.
Created: 2016-01-04 16:21:50.0
Updated: 2018-04-05 13:41:19.0
Pushed: 2018-03-23 11:39:07.0
Size: 917
Language: Swift
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
RxMKMapView is a RxSwift wrapper for MKMapView (MapKit) delegate
providing a Reactive Delegate Proxy as well as a bindable annotations interface to dynamically change the “data source” of your map.
RxMKMapView is available through CocoaPods. To install it, simply add the following line to your Podfile:
"RxMKMapView"
Add this to Cartfile
ub "RxSwiftCommunity/RxMKMapView"
ARK: Setup MKMapView
mapView = MKMapView(frame: view.frame)
.addSubview(mapView)
ARK: Bind Annotations
estForAnnotations() // Observable<[MyMapAnnotation]>
.asDriver(onErrorJustReturn: [])
.drive(mapView.rx.annotations)
.disposed(by: disposeBag)
ARK: Respond to Loading Events
iew.rx.willStartLoadingMap
.asDriver()
.drive(onNext: {
print("map started loadedloading)
})
.disposed(by: disposeBag)
iew.rx.didFinishLoadingMap
.asDriver()
.drive(onNext: {
print("map finished loading")
})
.disposed(by: disposeBag)
RxMKMapView requires Swift 4.0 and RxSwift (4.0).
RxMKMapView is available under the MIT license. See the LICENSE file for more info.