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 1e98878 commit c4488ab
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 @@ -401,22 +401,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 @@ -428,12 +428,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 c4488ab

Please sign in to comment.