Latest 1.0.6
Homepage https://github.com/greenSyntax/CLHelper
License MIT
Platforms ios 9.0
Authors

Core Location Helper

CI Status
Version
License
Platform

Features

Core Location framework supports majorly,

  • [x] User Current Location
  • [x] Geocoding (via Apple Geocoder)
  • [x] Reverse Geocoding (via Apple Geocoder)
  • [ ] Geocoding (via Google Places APIs)
  • [ ] Near By Places (via Google Landark APIs)
  • [ ] Geofencing

And, this helper class will cover all the functionality under the single hood.

Installation

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

pod 'CLHelper'

Usage

First, import the module in your screen,

import CLHelper

Current Location Update

*If There is sucess, then you’ll get an array of locations of CLLocation type.


CLHelper.shared.getLocation { (locations, error) in

    // Latest Coordinate
    print(locations?.last)
}
  • If you have error occured, then there is an object of CLHelperError

CLHelper.shared.getLocation { (locations, error) in

    print(error?.localizedText)
}

Geocoding

It will convert your address string into coordinate (lat-long).


CLHelper.shared.getCoordinate(fromAddress: "New Delhi") { (coordinate, error) in

        guard error == nil else {

            print(error.localizedText)
            return
        }

        // Get Coordinate
        print(coordinate?.latitude)
        print(coordinate?.longitude)

}

Reverse Geocoding

It will convert your coordinate (i.e. latitude longitude) into human-readable geographical address.


// Gurgaon Coordinate
let coordinate = Coordinate(latitude: 28.4595, longitude: 77.0266)

CLHelper.shared.getAddress(fromCoordinate: coordinate) { (address, error) in

        guard error == nil else {
            print(error?.localizedText)
            return
        }

        if let suitedAddress: GeographicalAddress = address?.first {
        print(suitedAddress)
    }
}

Versions Log

v1.0.6

  • [x] Added Travis CI

v1.0.5

  • [x] README Updated

v1.0.4

  • [x] Singleton Class
  • [x] Example Project Added
  • [x] Added Comments in CLHelper.

v1.0.1

  • [x] User Current Location
  • [x] Geocoding (via Apple Geocoder)
  • [x] Reverse Geocoding (via Apple Geocoder)

Contributor

Abhishek Kumar Ravi

[email protected]

License

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

Latest podspec

{
    "name": "CLHelper",
    "version": "1.0.6",
    "summary": "A Classic way to manage Core Location Jobs",
    "description": "'CLHelper is a helper file which will help in managing all your Core Location related task in a neat way with closures.'",
    "homepage": "https://github.com/greenSyntax/CLHelper",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Abhishek Kumar Ravi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/greenSyntax/CLHelper.git",
        "tag": "1.0.6"
    },
    "social_media_url": "https://twitter.com/greenSyntax",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "CLHelper/Classes/**/*"
}

Pin It on Pinterest

Share This