-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MapViewController Refactoring #195
MapViewController Refactoring #195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Left a comment about my favourite topic ;)
|
||
private func display(locations: [String: Location]) { | ||
guard LocationManager.accessPermission == .authorized else { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can log a message here
} | ||
|
||
extension MKMapView { | ||
func register<T: MKAnnotationView>(annotationViewType: T.Type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I moved Annotation specific logic out of MapViewController into its own controller as the current MapView infrastructure becomes hard to maintain if we add more logic to it in the future.
If we wanna add more annotationTypes (Friends, events etc), we'll just need to create a new
AnnotationController
subclass and add that toprivate lazy var annotationController: [AnnotationController]
and the rest should work out of the box