<commit_before>LocationManager
=====================

Location manager is a CLLocationManager wrapper written entirely in Swift
----------------------------------
**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


----------


**Try this too:**
https://github.com/varshylmobile/MapManager


----------


Screenshot
==========

![Screenshot](https://s3.amazonaws.com/cocoacontrols_production/uploads/control_image/image/4589/iOS_Simulator_Screen_Shot_28-Aug-2014_4.00.24_pm.png)



Sample code
-----------
***Closure***

**Location update**

    var locationManager = LocationManager.sharedInstance
            locationManager.showVerboseMessage = true
            locationManager.autoUpdate = false
            locationManager.startUpdatingLocationWithCompletionHandler { (latitude, longitude, status, verboseMessage, error) -> () in
                
                println("lat:\(latitude) lon:\(longitude) status:\(status) error:\(error)")
                
                println(verboseMessage)
                
            }

**Geocoding using Apple service**

 

    var locationManager = LocationManager.sharedInstance
            
    locationManager.geocodeAddressString(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 Apple service**

    var locationManager = LocationManager.sharedInstance
                locationManager.reverseGeocodeLocationWithLatLon(latitude: 37.331789, longitude: -122.029620) { (reverseGecodeInfo,placemark,error) -> Void in
                
                if(error != nil){
                    
                    println(error)
                }else{
                    
                    println(reverseGecodeInfo!)
                }
                
            }

**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!)
                }
            }

----------

***Delegate***

**Location update**

    *class ViewController: UIViewController ,LocationManagerDelegate{....*
    
    override func viewDidLoad() {
        
        super.viewDidLoad()
        
        var locationManager = LocationManager.sharedInstance
        
        locationManager.delegate = self
        
        locationManager.startUpdatingLocation()
        
        locationManager.stopUpdatingLocation()
    }
    
     func locationManagerStatus(status:NSString){
        
        println(status)
    }
    
    
    func locationManagerReceivedError(error:NSString){
        
        println(error)
        
    }
    
    func locationFoundGetAsString(latitude: NSString, longitude: NSString) {
       
    }
    
    
    func locationFound(latitude:Double, longitude:Double){
        
    }

----------

Verbose Message based on CLAuthorizationStatus
---------------

 - App is Authorized to use location services.
 
 - You have not yet made a choice with regards to this application.
 
 - This application is not authorized to use location services. Due to
   active restrictions on location services, the user cannot change this
   status, and may not have personally denied authorization.

 - You have explicitly denied authorization for this application, or
   location services are disabled in Settings.

----------

***Add Privacy - Location Usage Description  and NSLocationWhenInUseUsageDescription in your plist***


Roadmap
---------------

 - Compatiblity check for iOS7 & iOS8  
 - iPhone4 and startMonitoringSignificantLocationChanges issue

----------

Contributors 
---------------
***All contributors will receive virtual high fives from me and for the heck of it lets forget you are a south paw***
![enter image description here](https://dl.dropbox.com/s/n32dq4fle8fh7l4/internet-high-five.jpg)


----------
Other Repos you might like
--------------------------<commit_msg>Readme updated<commit_after>LocationManager
=====================

Location manager is a CLLocationManager wrapper written entirely in Swift
----------------------------------
**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


----------


**Try this too:**
https://github.com/varshylmobile/MapManager


----------


Screenshot
==========

![Screenshot](https://s3.amazonaws.com/cocoacontrols_production/uploads/control_image/image/4589/iOS_Simulator_Screen_Shot_28-Aug-2014_4.00.24_pm.png)



Sample code
-----------
***Closure***

**Location update**

    var locationManager = LocationManager.sharedInstance
            locationManager.showVerboseMessage = true
            locationManager.autoUpdate = false
            locationManager.startUpdatingLocationWithCompletionHandler { (latitude, longitude, status, verboseMessage, error) -> () in
                
                println("lat:\(latitude) lon:\(longitude) status:\(status) error:\(error)")
                
                println(verboseMessage)
                
            }

**Geocoding using Apple service**

 

    var locationManager = LocationManager.sharedInstance
            
    locationManager.geocodeAddressString(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 Apple service**

    var locationManager = LocationManager.sharedInstance
                locationManager.reverseGeocodeLocationWithLatLon(latitude: 37.331789, longitude: -122.029620) { (reverseGecodeInfo,placemark,error) -> Void in
                
                if(error != nil){
                    
                    println(error)
                }else{
                    
                    println(reverseGecodeInfo!)
                }
                
            }

**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!)
                }
            }

----------

***Delegate***

**Location update**

    *class ViewController: UIViewController ,LocationManagerDelegate{....*
    
    override func viewDidLoad() {
        
        super.viewDidLoad()
        
        var locationManager = LocationManager.sharedInstance
        
        locationManager.delegate = self
        
        locationManager.startUpdatingLocation()
        
        locationManager.stopUpdatingLocation()
    }
    
     func locationManagerStatus(status:NSString){
        
        println(status)
    }
    
    
    func locationManagerReceivedError(error:NSString){
        
        println(error)
        
    }
    
    func locationFoundGetAsString(latitude: NSString, longitude: NSString) {
       
    }
    
    
    func locationFound(latitude:Double, longitude:Double){
        
    }

----------

Verbose Message based on CLAuthorizationStatus
---------------

 - App is Authorized to use location services.
 
 - You have not yet made a choice with regards to this application.
 
 - This application is not authorized to use location services. Due to
   active restrictions on location services, the user cannot change this
   status, and may not have personally denied authorization.

 - You have explicitly denied authorization for this application, or
   location services are disabled in Settings.

----------

***Add Privacy - Location Usage Description  and NSLocationWhenInUseUsageDescription in your plist***


Roadmap
---------------

 - Compatiblity check for iOS7 & iOS8  
 - iPhone4 and startMonitoringSignificantLocationChanges issue

----------

Contributors 
---------------
***All contributors will receive virtual high fives from me and for the heck of it lets forget you are a south paw***

![enter image description here](https://dl.dropbox.com/s/n32dq4fle8fh7l4/internet-high-five.jpg)


----------
Other Repos you might like
--------------------------
{'fraction_non_alphanumeric': 0.11089755910051893, 'fraction_numerical': 0.014030367095906209, 'mean_word_length': 1.8210897262130659, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5337491', 'n_tokens_mistral': 2760, 'n_tokens_neox': 2481, 'n_words': 643}