You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library is obviously concentrated on UITableView and UICollectionView support but MKMapView has a lot of the same concepts: registering annotations and dequeuing them.
I currently use a simple extension for that
extensionMKMapView{finalfunc register<T:MKAnnotationView>(annotationType:T.Type)where T:Reusable{self.register(annotationType.self, forAnnotationViewWithReuseIdentifier: annotationType.reuseIdentifier)}finalfunc dequeueReusableAnnotation<T:MKAnnotationView>(annotationType:T.Type=T.self)->Twhere T:Reusable{guardlet view =self.dequeueReusableAnnotationView(withIdentifier: annotationType.reuseIdentifier)as?Telse{fatalError("Failed to dequeue a annotation view with identifier \(annotationType.reuseIdentifier) matching type \(annotationType.self). "+"Check that the reuseIdentifier is set properly in your XIB/Storyboard "+"and that you registered the annotation view beforehand")}return view
}}
I wonder if you be willing to add MKMapView support. I can provide this extension as a PR together with some documentation and maybe even a sample.
The text was updated successfully, but these errors were encountered:
This library is obviously concentrated on
UITableView
andUICollectionView
support butMKMapView
has a lot of the same concepts: registering annotations and dequeuing them.I currently use a simple extension for that
I wonder if you be willing to add
MKMapView
support. I can provide this extension as a PR together with some documentation and maybe even a sample.The text was updated successfully, but these errors were encountered: