Skip to content

Commit

Permalink
Fix some formatting issues and rename clManager to locationManager
Browse files Browse the repository at this point in the history
  • Loading branch information
fnakstad committed Mar 15, 2016
1 parent 66a029f commit c73f57a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions Source/CameraView/CameraView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -413,22 +413,22 @@ class CameraView: UIViewController, CLLocationManagerDelegate {
}

class LocationManager: NSObject, CLLocationManagerDelegate {
var clManager = CLLocationManager()
var locationManager = CLLocationManager()
var latestLocation: CLLocation?

override init() {
super.init()
clManager.delegate = self
clManager.desiredAccuracy = kCLLocationAccuracyBest
clManager.requestWhenInUseAuthorization()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.requestWhenInUseAuthorization()
}

func startUpdatingLocation() {
clManager.startUpdatingLocation()
locationManager.startUpdatingLocation()
}

func stopUpdatingLocation() {
clManager.stopUpdatingLocation()
locationManager.stopUpdatingLocation()
}

// MARK: - CLLocationManagerDelegate
Expand All @@ -440,12 +440,9 @@ class LocationManager: NSObject, CLLocationManagerDelegate {

func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus) {
if status == .AuthorizedAlways || status == .AuthorizedWhenInUse {
clManager.startUpdatingLocation()
locationManager.startUpdatingLocation()
} else {
clManager.stopUpdatingLocation()
locationManager.stopUpdatingLocation()
}
}

func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
}
}
}

0 comments on commit c73f57a

Please sign in to comment.