Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RxSwiftCommunity/RxMKMapView
RxMKMapView is a RxSwift wrapper for MKMapView `delegate`.
https://github.com/RxSwiftCommunity/RxMKMapView
Last synced: about 2 months ago
JSON representation
RxMKMapView is a RxSwift wrapper for MKMapView `delegate`.
- Host: GitHub
- URL: https://github.com/RxSwiftCommunity/RxMKMapView
- Owner: RxSwiftCommunity
- License: mit
- Created: 2016-01-04T16:21:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T13:56:47.000Z (11 months ago)
- Last Synced: 2024-10-28T12:55:37.137Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 1.71 MB
- Stars: 120
- Watchers: 28
- Forks: 48
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rxswift - RxMKMapView
README
RxMKMapView
===RxMKMapView is a [RxSwift](https://github.com/ReactiveX/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](https://circleci.com/gh/RxSwiftCommunity/RxMKMapView.svg?style=svg)](https://circleci.com/gh/RxSwiftCommunity/RxMKMapView)
[![Version](https://img.shields.io/cocoapods/v/RxMKMapView.svg?style=flat)](http://cocoapods.org/pods/RxMKMapView)
[![License](https://img.shields.io/cocoapods/l/RxMKMapView.svg?style=flat)](http://cocoapods.org/pods/RxMKMapView)
[![Platform](https://img.shields.io/cocoapods/p/RxMKMapView.svg?style=flat)](http://cocoapods.org/pods/RxMKMapView)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)## Installation
### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
RxMKMapView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "RxMKMapView"
```### [Carthage](https://github.com/Carthage/Carthage)
Add this to `Cartfile`
```
github "RxSwiftCommunity/RxMKMapView"
```## Example Usages
```swift
// MARK: Setup MKMapViewlet 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 5 and RxSwift 6.0.
For the last RxSwift 5.x support, please use RxMKMapView 5.1.0.## License
RxMKMapView is available under the MIT license. See the LICENSE file for more info.