Created
September 6, 2017 04:24
-
-
Save vc7/ad49244def6b5a174b3f9eb314893750 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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