LocationManager (Swift)

MIT License
Swift
iOS

Powered by Appetize.io.

1 image

Author

Description

CLLocationManager wrapper in Swift, performs location update, geocoding and reverse geocoding using Apple and Google service

Features:

1) Location update with closure & delegate support

2) Geocoding and reverse geocoding using Apple service

3) Geocoding and reverse geocoding using Google service

4) Closure returns CLPlacemark object, making it easier to place pin on map

SAMPLE CODE:

Geocoding using Google service

var locationManager = LocationManager.sharedInstance

locationManager.geocodeUsingGoogleAddressString(address: "Apple Inc., Infinite Loop, Cupertino, CA 95014, United States") { (geocodeInfo,placemark,error) -> Void in

        if(error != nil){

            println(error)

        }else{

            println(geocodeInfo!)
        }

    }

Reverse Geocoding using Google service

var locationManager = LocationManager.sharedInstance

locationManager.reverseGeocodeLocationUsingGoogleWithLatLon(latitude: 37.331789, longitude: -122.029620) { (reverseGecodeInfo,placemark,error) -> Void in

        if(error != nil){

            println(error)

        }else{

            println(reverseGecodeInfo!)
        }
    }

Tags