Skip to content

ShabanKamell/RxLocation-iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RxLocation

An RX wrapper for iOS location. It's simple and powerful.

Version License Platform

Usage

Choose a persmission

Choose authorizeWhenInUse or authorizeAlways for permission.

var rxLocation = RxLocation(authorization: .authorizeAlways)

Current Location

var rxLocation = RxLocation(authorization: .authorizeAlways)

   rxLocation.requestCurrentLocation()
      .subscribe(onNext: { location in
          print(location)
       })

Location Updates

  rxLocation.requestLocationUpdates()
      .subscribe(onNext: { locations in
          print(locations[0])
       })

Stop Updates

To stop updates in case of using rxLocation.requestLocationUpdates()

  rxLocation.stopLocationUpdates()

Location Manager Options

You can set any options for CLLocationManager, for example:

  rxLocation.locationManager.showsBackgroundLocationIndicator = true

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

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

pod 'RxLocation'

Author

ShabanKamell, sh3ban.kamel@gmail.com

License

RxLocation is available under the Apache license v2.0. See the LICENSE file for more info.