Slide 1

Slide 1 text

iOS 11 MapKit Annotation Clustering ᪴襊妿涢藳 by @denkeni

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

With Clustering1 Looks cleaner2. 2 App Store: CafeFreelance - ૡ֢߅珹記 1 https://github.com/Nandalu/NDLAnnotationClustering

Slide 4

Slide 4 text

With 2 types of Clustering Overlapping looks not so good...

Slide 5

Slide 5 text

iOS 11 Annotation Clustering IS OUT!!!

Slide 6

Slide 6 text

clusteringIdentifier3 An identifier that determines whether the annotation view participates in clustering. var clusteringIdentifier: String? { get set } The default value of this property is nil, which prevents the annotation view from being clustered with other annotation views. Setting the property to a non nil value it to participate in clustering. 3 Documentation > MapKit > MKAnnotationView > clusteringIdentifier

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

final class AnnotaionView : MKMarkerAnnotationView { override init(annotation: MKAnnotation?, reuseIdentifier: String?) { super.init(annotation: annotation, reuseIdentifier: reuseIdentifier) clusteringIdentifier = "AnnotaionView" } } DID NOT WORK (But seems to work now, at latest version)

Slide 9

Slide 9 text

Working code4 final class AnnotaionView : MKMarkerAnnotationView { override var annotation: MKAnnotation? { willSet { clusteringIdentifier = "AnnotaionView" } } } 4 What's New in MapKit, WWDC 2017 - Session 237

Slide 10

Slide 10 text

On iOS 11.1 Crash rdar://35381219

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

On iOS 11.2 Crash rdar://36131654

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Summary: — Use MapKit Annotation Clustering on iOS 11.3 or later — Question, or help5? 5 https://github.com/Nandalu/Housing