Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malekkamel/rxlocation-ios
An RX wrapper for iOS location
https://github.com/malekkamel/rxlocation-ios
cllocationmanager ios location swift xcode
Last synced: about 1 month ago
JSON representation
An RX wrapper for iOS location
- Host: GitHub
- URL: https://github.com/malekkamel/rxlocation-ios
- Owner: MalekKamel
- License: other
- Created: 2019-06-11T23:44:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-14T12:51:26.000Z (over 5 years ago)
- Last Synced: 2024-11-13T00:47:23.389Z (about 2 months ago)
- Topics: cllocationmanager, ios, location, swift, xcode
- Language: Swift
- Homepage:
- Size: 250 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxLocation
An RX wrapper for iOS location. It's simple and powerful.
[![Version](https://img.shields.io/cocoapods/v/RxLocation.svg?style=flat)](https://cocoapods.org/pods/RxLocation)
[![License](https://img.shields.io/cocoapods/l/RxLocation.svg?style=flat)](https://cocoapods.org/pods/RxLocation)
[![Platform](https://img.shields.io/cocoapods/p/RxLocation.svg?style=flat)](https://cocoapods.org/pods/RxLocation)## Usage
#### Choose a persmission
Choose `authorizeWhenInUse` or `authorizeAlways` for permission.```swift
var rxLocation = RxLocation(authorization: .authorizeAlways)
```#### Current Location
```swift
var rxLocation = RxLocation(authorization: .authorizeAlways)rxLocation.requestCurrentLocation()
.subscribe(onNext: { location in
print(location)
})
```#### Location Updates
```swift
rxLocation.requestLocationUpdates()
.subscribe(onNext: { locations in
print(locations[0])
})
```#### Stop Updates
To stop updates in case of using `rxLocation.requestLocationUpdates()`
```swift
rxLocation.stopLocationUpdates()```
#### Location Manager Options
You can set any options for CLLocationManager, for example:```swift
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](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'RxLocation'
```## Author
ShabanKamell, [email protected]
## License
RxLocation is available under the Apache license v2.0. See the LICENSE file for more info.