Skip to content

Instantly share code, notes, and snippets.

@vc7
Created September 6, 2017 04:24
Show Gist options
  • Select an option

  • Save vc7/ad49244def6b5a174b3f9eb314893750 to your computer and use it in GitHub Desktop.

Select an option

Save vc7/ad49244def6b5a174b3f9eb314893750 to your computer and use it in GitHub Desktop.
protocol LocationManageable {
var delegate: LocationManageableDelegate?
}
protocol LocationManageableDelegate {
func aMethod()
}
class LocationManager: LocationManageable {
static let shared = LocationManager()
// MARK: - LocationManageable
var delegate: LocationManageableDelegate?
}
class MyViewController: UIViewController, LocationManageableDelegate {
var locationManager: LocationManageable = LocationManager.shared
func viewDidLoad() {
super.viewDidLoad()
self.locationManager.delegate = self
}
// MARK: - LocationManageableDelegate
func aMethod() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment