<commit_before>//  LocationManager.swift
//  All-The-Weathers
//  Created by <NAME> on 10/19/15.
//  Copyright © 2015 <NAME>. All rights reserved.

import Foundation
import CoreLocation

final class LocationManager: NSObject {
    
    static let sharedInstance = LocationManager()
    
    dynamic var currentLocation: Location?
    
    private lazy var cllocationManager: CLLocationManager = {
        let locationManager = CLLocationManager()
        locationManager.delegate = self
        locationManager.requestWhenInUseAuthorization()
        
        return locationManager
    }()
    
    func updateLocation() {
        cllocationManager.startUpdatingLocation()
    }
}

extension LocationManager: CLLocationManagerDelegate {
    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        cllocationManager.stopUpdatingLocation()
        CLGeocoder().reverseGeocodeLocation(locations.last!) { (placemarks, error) -> Void in
            if let placemark = placemarks?[0] {
                self.currentLocation = Location(city: placemark.locality!, state: placemark.administrativeArea!)
            }
        }
    }
}<commit_msg>Changes location init to init with place mark.<commit_after>//  LocationManager.swift
//  All-The-Weathers
//  Created by <NAME> on 10/19/15.
//  Copyright © 2015 <NAME>. All rights reserved.

import Foundation
import CoreLocation

final class LocationManager: NSObject {
    
    static let sharedInstance = LocationManager()
    
    dynamic var currentLocation: Location?
    
    private lazy var cllocationManager: CLLocationManager = {
        let locationManager = CLLocationManager()
        locationManager.delegate = self
        locationManager.requestWhenInUseAuthorization()
        
        return locationManager
    }()
    
    func updateLocation() {
        cllocationManager.startUpdatingLocation()
    }
}

extension LocationManager: CLLocationManagerDelegate {
    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        cllocationManager.stopUpdatingLocation()
        CLGeocoder().reverseGeocodeLocation(locations.last!) { (placemarks, error) -> Void in
            if let placemark = placemarks?[0] {
                self.currentLocation = Location(placemark: placemark)
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.0818490245971162, 'fraction_numerical': 0.009329940627650551, 'mean_word_length': 3.00509337860781, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '3518013', 'n_tokens_mistral': 618, 'n_tokens_neox': 611, 'n_words': 147}