ribl / FBAnnotationClusteringSwift

Swift translation of FB Annotation Clustering, which clusters pins on the map for iOS.
http://ribl.co/blog/2015/05/28/map-clustering-with-swift-how-we-implemented-it-into-the-ribl-ios-app/
MIT License
311 stars 109 forks source link

FBClusteringManager holds strong reference to delegate #39

Open ghost opened 8 years ago

ghost commented 8 years ago

In its current implementation, setting the FBClusteringManager delegate to a class that references the FBClusteringManager class (e.g., clusteringManager.delegate = self in the ViewController that displays the map) causes a retain cycle. Setting the delegate to a weak var and the delegate protocol to a class-protocol fixes the issue.

chenr2 commented 8 years ago

Thanks for pointing this out @wesleyorbin. Feel free to submit a pull request.