NRLocationManager: This class is used to provide a location updates via completion handler. Some of the main features of this library are:
- One time Location
- Continous Location
- Significant Location
- Check System location is on/off
To run the example project, clone the repo, and run pod install
from the Example directory first.
Xcode 9+ , Swift 4 , iOS 9 and above
Please make sure you have the below keys in your plist file before using the location services.
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Description</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Will you allow this app to always know your location?</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Do you allow this app to know your current location?</string>
Also enable background mode for location :
UIBackgroundModes -> Location updates
NRLocationManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "NRLocationManager"
@IBAction func oneTimeLocationButtonPressed() {
updateLabel(string: "One Time Location ...")
NRLocationManger.shared.fetchLocation(locationType: .onetime) { (location, error) in
if error != nil {
} }
}
@IBAction func oneTimeLocationButtonPressed() {
updateLabel(string: "One Time Location ...")
NRLocationManger.shared.fetchLocation(locationType: .continous) { (location, error) in
if error != nil {
}}
}
@IBAction func oneTimeLocationButtonPressed() {
updateLabel(string: "One Time Location ...")
NRLocationManger.shared.fetchLocation(locationType: .significant) { (location, error) in
if error != nil {
}}
}
Contributions are always welcome! (:
- Fork it ( http://github.com/naveenrana1309/NRLocationManager/fork )
- Create your feature branch ('git checkout -b my-new-feature')
- Commit your changes ('git commit -am 'Add some feature')
- Push to the branch ('git push origin my-new-feature')
- Create new Pull Request
Xcode 9+ , Swift 4 , iOS 10 and above
Naveen Rana. See Profile
Email: naveenrana1309@gmail.com.
Check out Facebook Profile for detail.
NRLocationManager is available under the MIT license. See the LICENSE file for more info.