Created
September 29, 2021 08:17
-
-
Save farhadmpr/f0d5f79c296d8b21ce788d360d5bcb07 to your computer and use it in GitHub Desktop.
Ambient Context #3
This file contains 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
class LocationManager: LocationService { | |
//.... | |
func isAuthorized() -> Bool { | |
switch authorizationStatus() { | |
case .authorizedAlways, | |
.authorizedWhenInUse: | |
return true | |
default: | |
return false | |
} | |
} | |
//.... | |
} | |
class DateProvider: DateProviderService { | |
var date: Date { | |
return Date() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment