Skip to content

Commit

Permalink
disable center button when location is not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
Yigal Omer committed Sep 26, 2018
1 parent 2706507 commit 4f22423
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Anyway/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ class ViewController: UIViewController, CLLocationManagerDelegate {
}
}

@IBAction func centerMyLocationButtonClicked(_ sender: Any) {
map.setUserTrackingMode(MKUserTrackingMode.follow, animated: true)
}



override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
Expand All @@ -118,6 +116,12 @@ class ViewController: UIViewController, CLLocationManagerDelegate {

//MARK: - Logic

@IBAction func centerMyLocationButtonClicked(_ sender: Any) {
if isLocationMonitoringAuthorized() {
map.moveAndZoom(to: map.userLocation.coordinate)
}
}

var isMapCloseEnoughToFetchData: Bool {
return btnFilter.isEnabled
}
Expand Down

0 comments on commit 4f22423

Please sign in to comment.