RxMKMapView 5.0.0

RxMKMapView 5.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jun 2019
SPMSupports SPM

Maintained by Marin Todorov, Spiros gerokostas, Thane Gill, Scott Gardner, RxSwift Community.



 
Depends on:
RxCocoa~> 5.0
RxSwift~> 5.0
 

  • By
  • RxSwift Community

RxMKMapView

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.

CircleCI Version License Platform Carthage compatible

Installation

CocoaPods

RxMKMapView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RxMKMapView"

Carthage

Add this to Cartfile

github "RxSwiftCommunity/RxMKMapView"

Example Usages

// MARK: Setup MKMapView

let mapView = MKMapView(frame: view.frame)
view.addSubview(mapView)

// MARK: Bind Annotations

requestForAnnotations() // Observable<[MyMapAnnotation]>
    .asDriver(onErrorJustReturn: [])
    .drive(mapView.rx.annotations)
    .disposed(by: disposeBag)

// MARK: Respond to Loading Events

mapView.rx.willStartLoadingMap
       .asDriver()
       .drive(onNext: {
           print("map started loadedloading")
       })
       .disposed(by: disposeBag)

mapView.rx.didFinishLoadingMap
       .asDriver()
       .drive(onNext: {
           print("map finished loading")
       })
       .disposed(by: disposeBag)

Requirements

RxMKMapView requires Swift 4.0 and RxSwift (4.4).

License

RxMKMapView is available under the MIT license. See the LICENSE file for more info.