diff --git a/.travis.yml b/.travis.yml index eba6d34..2a23609 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode10.1 +osx_image: xcode10.2 env: global: - FRAMEWORK_NAME=ClusterKit @@ -10,10 +10,10 @@ before_install: install: - gem install cocoapods -- gem install xcpretty --no-rdoc --no-ri --no-document --quiet +- gem install xcpretty --no-document --quiet script: -- set -o pipefail && xcodebuild -project ClusterKit.xcodeproj -scheme $FRAMEWORK_NAME -sdk iphonesimulator12.1 -configuration Release -destination "platform=iOS Simulator,name=iPhone 8" clean build test | xcpretty -c +- set -o pipefail && xcodebuild -project ClusterKit.xcodeproj -scheme $FRAMEWORK_NAME -sdk iphonesimulator12.2 -configuration Release -destination "platform=iOS Simulator,name=iPhone 8" clean build test | xcpretty -c - pod lib lint --quick before_deploy: diff --git a/ClusterKit.xcodeproj/project.pbxproj b/ClusterKit.xcodeproj/project.pbxproj index bcf994d..bcc26bd 100644 --- a/ClusterKit.xcodeproj/project.pbxproj +++ b/ClusterKit.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 9C2C4A0E1F94BACE00B22745 /* MGLMapView+ClusterKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C2C4A0C1F94BACE00B22745 /* MGLMapView+ClusterKit.h */; }; 9C53CD191E03F51C000AD9B8 /* CKClusterAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C53CD041E03F51C000AD9B8 /* CKClusterAlgorithm.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9C53CD1A1E03F51C000AD9B8 /* CKClusterAlgorithm.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C53CD051E03F51C000AD9B8 /* CKClusterAlgorithm.m */; }; 9C53CD1B1E03F51C000AD9B8 /* CKNonHierarchicalDistanceBasedAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C53CD061E03F51C000AD9B8 /* CKNonHierarchicalDistanceBasedAlgorithm.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -266,7 +265,6 @@ 9CE1F2691E069F30007E2678 /* CKGridBasedAlgorithm.h in Headers */, 9C53CD1D1E03F51C000AD9B8 /* CKCluster.h in Headers */, 9C53CD211E03F51C000AD9B8 /* CKMap.h in Headers */, - 9C2C4A0E1F94BACE00B22745 /* MGLMapView+ClusterKit.h in Headers */, 9C53CD191E03F51C000AD9B8 /* CKClusterAlgorithm.h in Headers */, 9CC875F31E02AE2D0019AA18 /* ClusterKit.h in Headers */, 9C53CD231E03F51C000AD9B8 /* CKQuadTree.h in Headers */, @@ -319,7 +317,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = CK; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Hulab; TargetAttributes = { 9CC8756E1E0295A30019AA18 = { @@ -334,7 +332,7 @@ }; buildConfigurationList = 9CC875691E0295A20019AA18 /* Build configuration list for PBXProject "ClusterKit" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -409,6 +407,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -469,6 +468,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; diff --git a/ClusterKit.xcodeproj/xcshareddata/xcschemes/ClusterKit.xcscheme b/ClusterKit.xcodeproj/xcshareddata/xcschemes/ClusterKit.xcscheme index c6378b6..1aefbba 100644 --- a/ClusterKit.xcodeproj/xcshareddata/xcschemes/ClusterKit.xcscheme +++ b/ClusterKit.xcodeproj/xcshareddata/xcschemes/ClusterKit.xcscheme @@ -1,6 +1,6 @@ annotation in annotations) { - if ([visited objectForKey:annotation]) { - continue; - } + if ([visited objectForKey:annotation]) continue; CKCluster *cluster = [self clusterWithCoordinate:annotation.coordinate]; [clusters addObject:cluster]; @@ -71,9 +69,7 @@ - (instancetype)init { CGFloat distance = CKDistance(neighbor.coordinate, cluster.coordinate); if (candidate) { - if (candidate.distance < distance) { - continue; - } + if (candidate.distance < distance) continue; [candidate.cluster removeAnnotation:neighbor]; } else { candidate = [[CKCandidate alloc] init]; diff --git a/ClusterKit/Core/CKCluster.h b/ClusterKit/Core/CKCluster.h index d2a0966..ea89dac 100644 --- a/ClusterKit/Core/CKCluster.h +++ b/ClusterKit/Core/CKCluster.h @@ -65,7 +65,7 @@ MK_EXTERN NSComparisonResult MKMapSizeCompare(MKMapSize size1, MKMapSize size2); /** Cluster coordinate. */ -@property (nonatomic) CLLocationCoordinate2D coordinate; +@property (nonatomic, readonly) CLLocationCoordinate2D coordinate; /** Cluster annotation array. @@ -165,6 +165,8 @@ MK_EXTERN NSComparisonResult MKMapSizeCompare(MKMapSize size1, MKMapSize size2); @end +#pragma mark - Centroid Cluster + /** Cluster with centroid coordinate. */ @@ -172,6 +174,8 @@ MK_EXTERN NSComparisonResult MKMapSizeCompare(MKMapSize size1, MKMapSize size2); @end +#pragma mark - Nearest Centroid Cluster + /** Cluster with coordinate at the nearest annotation from centroid. */ @@ -179,6 +183,8 @@ MK_EXTERN NSComparisonResult MKMapSizeCompare(MKMapSize size1, MKMapSize size2); @end +#pragma mark - Bottom Cluster + /** Cluster with coordinate at the bottom annotion. */ diff --git a/ClusterKit/Core/CKCluster.m b/ClusterKit/Core/CKCluster.m index ecba8ec..f9917ee 100644 --- a/ClusterKit/Core/CKCluster.m +++ b/ClusterKit/Core/CKCluster.m @@ -74,6 +74,10 @@ - (instancetype)init{ return _annotations.array; } +- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate { + _coordinate = newCoordinate; +} + - (MKMapRect)bounds { if (_invalidate_bounds) { _bounds = MKMapRectNull; @@ -180,6 +184,8 @@ - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state object @end +#pragma mark - Centroid Cluster + @implementation CKCentroidCluster - (void)addAnnotation:(id)annotation { @@ -224,6 +230,8 @@ - (CLLocationCoordinate2D)coordinateByRemovingAnnotation:(id)annot @end +#pragma mark - Nearest Centroid Cluster + @implementation CKNearestCentroidCluster { CLLocationCoordinate2D _center; } @@ -264,6 +272,8 @@ - (CLLocationCoordinate2D)coordinateByDistanceSort { @end +#pragma mark - Bottom Cluster + @implementation CKBottomCluster - (void)addAnnotation:(id)annotation { diff --git a/ClusterKit/Core/CKClusterManager.h b/ClusterKit/Core/CKClusterManager.h index 3de5de5..c23e4bd 100644 --- a/ClusterKit/Core/CKClusterManager.h +++ b/ClusterKit/Core/CKClusterManager.h @@ -33,7 +33,8 @@ FOUNDATION_EXTERN const double kCKMarginFactorWorld; @class CKClusterManager; /** - The delegate of a CKClusterManager object may adopt the CKClusterManagerDelegate protocol. Optional methods of the protocol allow the delegate to manage clustering and animations. + The delegate of a CKClusterManager object may adopt the CKClusterManagerDelegate protocol. + Optional methods of the protocol allow the delegate to manage clustering and animations. */ @protocol CKClusterManagerDelegate @@ -43,7 +44,7 @@ FOUNDATION_EXTERN const double kCKMarginFactorWorld; Asks the delegate if the cluster manager should clusterized the given annotation. @param clusterManager The cluster manager object requesting this information. - @param annotation The annotation to clusterized. + @param annotation The annotation to clusterized. @return Yes to permit clusterization of the given annotation. */ @@ -54,7 +55,9 @@ FOUNDATION_EXTERN const double kCKMarginFactorWorld; @param clusterManager The cluster manager object requesting the animation. @param animations A block object containing the animation. This block takes no parameters and has no return value. This parameter must not be NULL. - @param completion A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called. If the duration of the animation is 0, this block is performed at the beginning of the next run loop cycle. This parameter may be NULL. + @param completion A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument + that indicates whether or not the animations actually finished before the completion handler was called. If the duration of the + animation is 0, this block is performed at the beginning of the next run loop cycle. This parameter may be NULL. */ - (void)clusterManager:(CKClusterManager *)clusterManager performAnimations:(void (^)(void))animations completion:(void (^ __nullable)(BOOL finished))completion; @@ -65,22 +68,22 @@ FOUNDATION_EXTERN const double kCKMarginFactorWorld; /** The total duration of the clusters animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them. */ -@property (assign, nonatomic) CGFloat animationDuration; +@property (nonatomic, assign) CGFloat animationDuration; /** A mask of options indicating how you want to perform the animations. For a list of valid constants, @see UIViewAnimationOptions. */ -@property (assign, nonatomic) UIViewAnimationOptions animationOptions; +@property (nonatomic, assign) UIViewAnimationOptions animationOptions; /** The cluster algorithm to use. @see CKClusterAlgorithm. */ -@property (nonatomic,strong) __kindof CKClusterAlgorithm *algorithm; +@property (nonatomic, strong) __kindof CKClusterAlgorithm *algorithm; /** A map object adopting the CKMap protocol. */ -@property (nonatomic,weak) id map; +@property (nonatomic, weak) id map; /** Delegate instance that adopt the CKClusterManagerDelegate protocol. @@ -90,7 +93,7 @@ FOUNDATION_EXTERN const double kCKMarginFactorWorld; /** The currently selected annotation. */ -@property (nonatomic,readonly) id selectedAnnotation; +@property (nonatomic, readonly) id selectedAnnotation; /** The current cluster array. @@ -110,7 +113,7 @@ FOUNDATION_EXTERN const double kCKMarginFactorWorld; /** The annotations to clusterize. */ -@property (nonatomic,copy) NSArray> *annotations; +@property (nonatomic, copy) NSArray> *annotations; /** Adds an annotation. @@ -190,9 +193,21 @@ FOUNDATION_EXTERN const double kCKMarginFactorWorld; Initializes an animation for the given cluster. @param cluster The cluster to animate. + @param from The cluster starting point. + @param to The cluster ending point. @return The initialized CKClusterAnimation object. */ -- (instancetype)initWithCluster:(CKCluster *)cluster NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithCluster:(CKCluster *)cluster from:(CLLocationCoordinate2D)from to:(CLLocationCoordinate2D)to NS_DESIGNATED_INITIALIZER; + +/** + Creates an animation for the given cluster. + + @param cluster The cluster to animate. + @param from The cluster starting point. + @param to The cluster ending point. + @return The initialized CKClusterAnimation object. + */ ++ (instancetype)animateCluster:(CKCluster *)cluster from:(CLLocationCoordinate2D)from to:(CLLocationCoordinate2D)to; /// :nodoc: - (instancetype)init NS_UNAVAILABLE; diff --git a/ClusterKit/Core/CKClusterManager.m b/ClusterKit/Core/CKClusterManager.m index 1bc7759..5582383 100644 --- a/ClusterKit/Core/CKClusterManager.m +++ b/ClusterKit/Core/CKClusterManager.m @@ -74,8 +74,8 @@ - (void)updateClustersIfNeeded { } else if (self.marginFactor != kCKMarginFactorWorld) { // Translation update - if(fabs(self.visibleMapRect.origin.x - visibleMapRect.origin.x) > self.visibleMapRect.size.width * self.marginFactor / 2|| - fabs(self.visibleMapRect.origin.y - visibleMapRect.origin.y) > self.visibleMapRect.size.height* self.marginFactor / 2 ) { + if (fabs(self.visibleMapRect.origin.x - visibleMapRect.origin.x) > self.visibleMapRect.size.width * self.marginFactor / 2 || + fabs(self.visibleMapRect.origin.y - visibleMapRect.origin.y) > self.visibleMapRect.size.height* self.marginFactor / 2 ) { [self updateMapRect:visibleMapRect animated:NO]; } } @@ -204,10 +204,8 @@ - (void)updateMapRect:(MKMapRect)visibleMapRect animated:(BOOL)animated { } - (void)setSelectedCluster:(CKCluster *)selectedCluster animated:(BOOL)animated { - if (selectedCluster == self.selectedCluster) { - return; - } - + if (selectedCluster == self.selectedCluster) return; + CKCluster *prev = self.selectedCluster; self.selectedCluster = selectedCluster; @@ -232,6 +230,7 @@ - (CKCluster *)clusterForAnnotation:(id)annotation { return cluster; } } + return nil; } @@ -255,9 +254,7 @@ - (void)expand:(NSArray *)newClusters from:(NSArray *) CKClusterAnimation *animation = [animations member:neighbor]; if (!animation) { - animation = [[CKClusterAnimation alloc] initWithCluster:neighbor]; - animation.from = oldCluster.coordinate; - animation.to = neighbor.coordinate; + animation = [CKClusterAnimation animateCluster:neighbor from:oldCluster.coordinate to:neighbor.coordinate]; [animations addObject:animation]; continue; } @@ -293,9 +290,7 @@ - (void)collapse:(NSArray *)oldClusters to:(NSArray *) CKClusterAnimation *animation = [animations member:neighbor]; if (!animation) { - animation = [[CKClusterAnimation alloc] initWithCluster:neighbor]; - animation.from = neighbor.coordinate; - animation.to = newCluster.coordinate; + animation = [CKClusterAnimation animateCluster:neighbor from:neighbor.coordinate to:newCluster.coordinate]; [animations addObject:animation]; continue; } @@ -318,9 +313,11 @@ - (BOOL)annotationTree:(id)annotationTree shouldExtractAnnotat if (annotation == self.selectedAnnotation) { return NO; } + if ([self.delegate respondsToSelector:@selector(clusterManager:shouldClusterAnnotation:)]) { return [self.delegate clusterManager:self shouldClusterAnnotation:annotation]; } + return YES; } @@ -328,12 +325,16 @@ - (BOOL)annotationTree:(id)annotationTree shouldExtractAnnotat @implementation CKClusterAnimation -- (instancetype)initWithCluster:(CKCluster *)cluster { ++ (instancetype)animateCluster:(CKCluster *)cluster from:(CLLocationCoordinate2D)from to:(CLLocationCoordinate2D)to { + return [[self alloc] initWithCluster:cluster from:from to:to]; +} + +- (instancetype)initWithCluster:(CKCluster *)cluster from:(CLLocationCoordinate2D)from to:(CLLocationCoordinate2D)to { self = [super init]; if (self) { _cluster = cluster; - _from = kCLLocationCoordinate2DInvalid; - _to = kCLLocationCoordinate2DInvalid; + _from = from; + _to = to; } return self; } @@ -342,12 +343,15 @@ - (BOOL)isEqual:(id)object { if (object == self) { return YES; } + if ([object isKindOfClass:[CKCluster class]]) { return [_cluster isEqualToCluster:object]; } + if (![object isKindOfClass:[CKClusterAnimation class]]) { return NO; } + CKClusterAnimation *obj = object; return [_cluster isEqualToCluster:obj->_cluster]; } diff --git a/ClusterKit/Core/Tree/CKAnnotationTree.h b/ClusterKit/Core/Tree/CKAnnotationTree.h index eb6700d..8cfb827 100644 --- a/ClusterKit/Core/Tree/CKAnnotationTree.h +++ b/ClusterKit/Core/Tree/CKAnnotationTree.h @@ -29,7 +29,8 @@ NS_ASSUME_NONNULL_BEGIN @protocol CKAnnotationTree; /** - The delegate of a CKAnnotationTree object may adopt the KPAnnotationTreeDelegate protocol. Optional method of the protocol allow the delegate to manage annotation extraction. + The delegate of a CKAnnotationTree object may adopt the KPAnnotationTreeDelegate protocol. + Optional method of the protocol allow the delegate to manage annotation extraction. */ @protocol CKAnnotationTreeDelegate diff --git a/ClusterKit/Core/Tree/CKQuadTree.h b/ClusterKit/Core/Tree/CKQuadTree.h index 93aef1c..29a5603 100644 --- a/ClusterKit/Core/Tree/CKQuadTree.h +++ b/ClusterKit/Core/Tree/CKQuadTree.h @@ -46,7 +46,12 @@ FOUNDATION_EXPORT void hb_qtree_find_in_range(hb_qtree_t *tree, MKMapRect range, A quadtree is a tree data structure in which each internal node has exactly four children. It is used to partition {@see MKMapRectWorld} by recursively subdividing it into four quadrants or regions. - The quadtree represents a partition of space in two dimensions by decomposing the region into four equal quadrants, subquadrants, and so on with each leaf node containing annotation corresponding to a specific rect. Each node in the tree either has maximum four children. The height of quadtrees that follow this decomposition strategy (i.e. subdividing subquadrants as long as there is interesting data in the subquadrant for which more refinement is desired) is sensitive to and dependent on the spatial distribution of interesting areas in the space being decomposed. The region quadtree is a type of trie. Regions are subdivided until each leaf contains at most a single point. + The quadtree represents a partition of space in two dimensions by decomposing the region into four equal quadrants, subquadrants, + and so on with each leaf node containing annotation corresponding to a specific rect. Each node in the tree either has maximum + four children. The height of quadtrees that follow this decomposition strategy (i.e. subdividing subquadrants as long as there is + interesting data in the subquadrant for which more refinement is desired) is sensitive to and dependent on the spatial distribution + of interesting areas in the space being decomposed. The region quadtree is a type of trie. Regions are subdivided until each leaf + contains at most a single point. */ @interface CKQuadTree : NSObject diff --git a/ClusterKit/Core/Tree/CKQuadTree.m b/ClusterKit/Core/Tree/CKQuadTree.m index 569ef16..56fb649 100644 --- a/ClusterKit/Core/Tree/CKQuadTree.m +++ b/ClusterKit/Core/Tree/CKQuadTree.m @@ -83,7 +83,7 @@ static void add_(hb_qnode_t *n, hb_qpoint_t *p) { static bool drop_(hb_qnode_t *n, id a) { - for (hb_qpoint_t *cur = n->points , *prev = NULL; + for (hb_qpoint_t *cur = n->points, *prev = NULL; cur != NULL; prev = cur, cur = cur->next) { @@ -119,10 +119,9 @@ static void subdivide_(hb_qnode_t *n) { } static bool hb_qnode_insert(hb_qnode_t *n, id a) { - MKMapPoint point = MKMapPointForCoordinate(a.coordinate); - if(!MKMapRectContainsPoint(n->bound, point)) - return false; + + if(!MKMapRectContainsPoint(n->bound, point)) return false; if(n->cnt < n->cap) { hb_qpoint_t *p = malloc(sizeof(hb_qpoint_t)); @@ -145,10 +144,7 @@ static bool hb_qnode_insert(hb_qnode_t *n, id a) { } static bool hb_qnode_remove(hb_qnode_t *n, id a) { - - if(drop_(n, a)) { - return true; - } + if(drop_(n, a)) return true; if(n->nw) { if(hb_qnode_remove(n->nw, a)) return true; @@ -156,14 +152,14 @@ static bool hb_qnode_remove(hb_qnode_t *n, id a) { if(hb_qnode_remove(n->sw, a)) return true; if(hb_qnode_remove(n->se, a)) return true; } + return false; } static void hb_qnode_get_in_range(hb_qnode_t *n, MKMapRect range, void(^find)(idannotation)) { if(n->cnt) { - if(!MKMapRectIntersectsRect(n->bound, range)) - return; + if(!MKMapRectIntersectsRect(n->bound, range)) return; hb_qpoint_t *p = n->points; while (p) { @@ -220,7 +216,7 @@ @interface CKQuadTree () @end @implementation CKQuadTree { - BOOL _responds; + BOOL _delegate_responds; } static void * const CKQuadTreeKVOContext = (void *)&CKQuadTreeKVOContext; @@ -257,7 +253,7 @@ - (instancetype)initWithAnnotations:(NSArray> *)annotations { if (MKMapRectSpans180thMeridian(rect)) { hb_qtree_find_in_range(self.tree, MKMapRectRemainder(rect), ^(id annotation) { - if (!self->_responds || [self.delegate annotationTree:self shouldExtractAnnotation:annotation]) { + if (!self->_delegate_responds || [self.delegate annotationTree:self shouldExtractAnnotation:annotation]) { [results addObject:annotation]; } }); @@ -266,7 +262,7 @@ - (instancetype)initWithAnnotations:(NSArray> *)annotations { } hb_qtree_find_in_range(self.tree, rect, ^(id annotation) { - if (!self->_responds || [self.delegate annotationTree:self shouldExtractAnnotation:annotation]) { + if (!self->_delegate_responds || [self.delegate annotationTree:self shouldExtractAnnotation:annotation]) { [results addObject:annotation]; } }); @@ -278,7 +274,7 @@ - (void)setDelegate:(id)delegate { _delegate = delegate; //Cache whether the delegate responds to a selector - _responds = [self.delegate respondsToSelector:@selector(annotationTree:shouldExtractAnnotation:)]; + _delegate_responds = [self.delegate respondsToSelector:@selector(annotationTree:shouldExtractAnnotation:)]; } - (void)dealloc { diff --git a/Examples/Example-swift/AppDelegate.swift b/Examples/Example-swift/AppDelegate.swift index 31a7b01..4a8cfc6 100644 --- a/Examples/Example-swift/AppDelegate.swift +++ b/Examples/Example-swift/AppDelegate.swift @@ -31,7 +31,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { GMSServices.provideAPIKey("<#Enter your google API key#>") MGLAccountManager.accessToken = "<#Enter your Mapbox access token#>" diff --git a/Examples/Example-swift/GoogleMapsViewController.swift b/Examples/Example-swift/GoogleMapsViewController.swift index 8920994..13f58b7 100644 --- a/Examples/Example-swift/GoogleMapsViewController.swift +++ b/Examples/Example-swift/GoogleMapsViewController.swift @@ -92,7 +92,7 @@ class GoogleMapsViewController: UIViewController, GMSMapViewDelegate, GMSMapView if let cluster = marker.cluster, cluster.count > 1 { - let padding = UIEdgeInsetsMake(40, 20, 44, 20) + let padding = UIEdgeInsets.init(top: 40, left: 20, bottom: 44, right: 20) let cameraUpdate = GMSCameraUpdate.fit(cluster, with: padding) mapView.animate(with: cameraUpdate) return true diff --git a/Examples/Example-swift/MapKitViewController.swift b/Examples/Example-swift/MapKitViewController.swift index 4fd8320..060e695 100644 --- a/Examples/Example-swift/MapKitViewController.swift +++ b/Examples/Example-swift/MapKitViewController.swift @@ -92,7 +92,7 @@ class MapKitViewController: UIViewController, MKMapViewDelegate { } if cluster.count > 1 { - let edgePadding = UIEdgeInsetsMake(40, 20, 44, 20) + let edgePadding = UIEdgeInsets.init(top: 40, left: 20, bottom: 44, right: 20) mapView.show(cluster, edgePadding: edgePadding, animated: true) } else if let annotation = cluster.firstAnnotation { mapView.clusterManager.selectAnnotation(annotation, animated: false); @@ -109,7 +109,7 @@ class MapKitViewController: UIViewController, MKMapViewDelegate { // MARK: - How To Handle Drag and Drop - func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationViewDragState, fromOldState oldState: MKAnnotationViewDragState) { + func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState) { guard let cluster = view.annotation as? CKCluster else { return } diff --git a/Examples/Example-swift/MapboxViewController.swift b/Examples/Example-swift/MapboxViewController.swift index 03be1fc..7abd22b 100644 --- a/Examples/Example-swift/MapboxViewController.swift +++ b/Examples/Example-swift/MapboxViewController.swift @@ -99,7 +99,7 @@ class MapboxViewController: UIViewController, MGLMapViewDelegate { if cluster.count > 1 { - let edgePadding = UIEdgeInsetsMake(40, 20, 44, 20) + let edgePadding = UIEdgeInsets.init(top: 40, left: 20, bottom: 44, right: 20) let camera = mapView.cameraThatFitsCluster(cluster, edgePadding: edgePadding) mapView.setCamera(camera, animated: true) diff --git a/Examples/Examples.xcodeproj/project.pbxproj b/Examples/Examples.xcodeproj/project.pbxproj index 239ac02..3851bda 100644 --- a/Examples/Examples.xcodeproj/project.pbxproj +++ b/Examples/Examples.xcodeproj/project.pbxproj @@ -468,7 +468,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Hulab; TargetAttributes = { 9C1A99E81EB9225800BEB563 = { @@ -487,7 +487,7 @@ }; 9CD80AF41E2306F400DFCB89 = { CreatedOnToolsVersion = 8.2; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Maps.iOS = { @@ -499,7 +499,7 @@ }; buildConfigurationList = 9CD80A861E23031700DFCB89 /* Build configuration list for PBXProject "Examples" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -614,6 +614,8 @@ "${BUILT_PRODUCTS_DIR}/ClusterKit/ClusterKit.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM", + "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/E3F066DB-FB3F-3DB3-ADCA-FD22D28B3593.bcsymbolmap", + "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/314B394E-4B8A-3249-ACB5-C8B038156249.bcsymbolmap", "${BUILT_PRODUCTS_DIR}/GeoJSONSerialization/GeoJSONSerialization.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -621,6 +623,8 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ClusterKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework", "${DWARF_DSYM_FOLDER_PATH}/Mapbox.framework.dSYM", + "${BUILT_PRODUCTS_DIR}/E3F066DB-FB3F-3DB3-ADCA-FD22D28B3593.bcsymbolmap", + "${BUILT_PRODUCTS_DIR}/314B394E-4B8A-3249-ACB5-C8B038156249.bcsymbolmap", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GeoJSONSerialization.framework", ); runOnlyForDeploymentPostprocessing = 0; @@ -638,6 +642,8 @@ "${BUILT_PRODUCTS_DIR}/ClusterKit/ClusterKit.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM", + "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/E3F066DB-FB3F-3DB3-ADCA-FD22D28B3593.bcsymbolmap", + "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/314B394E-4B8A-3249-ACB5-C8B038156249.bcsymbolmap", "${BUILT_PRODUCTS_DIR}/GeoJSONSerialization/GeoJSONSerialization.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -645,6 +651,8 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ClusterKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework", "${DWARF_DSYM_FOLDER_PATH}/Mapbox.framework.dSYM", + "${BUILT_PRODUCTS_DIR}/E3F066DB-FB3F-3DB3-ADCA-FD22D28B3593.bcsymbolmap", + "${BUILT_PRODUCTS_DIR}/314B394E-4B8A-3249-ACB5-C8B038156249.bcsymbolmap", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GeoJSONSerialization.framework", ); runOnlyForDeploymentPostprocessing = 0; @@ -792,7 +800,7 @@ baseConfigurationReference = 6342D7FB7C4927C2B322BA29 /* Pods-Example-data.debug.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -833,6 +841,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -892,6 +901,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -991,7 +1001,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OBJC_BRIDGING_HEADER = "Example-swift/Example-swift-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1008,7 +1018,7 @@ PRODUCT_NAME = "ClusterKit Swift"; SWIFT_OBJC_BRIDGING_HEADER = "Example-swift/Example-swift-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Examples/Podfile.lock b/Examples/Podfile.lock index 9c68963..41a2af2 100644 --- a/Examples/Podfile.lock +++ b/Examples/Podfile.lock @@ -2,19 +2,19 @@ PODS: - ClusterKit/Core (0.4.0) - ClusterKit/Mapbox (0.4.0): - ClusterKit/Core - - Mapbox-iOS-SDK (~> 4.6) + - Mapbox-iOS-SDK (~> 5.0) - ClusterKit/MapKit (0.4.0): - ClusterKit/Core - GeoJSONSerialization (0.0.4) - - GoogleMaps (2.7.0): - - GoogleMaps/Maps (= 2.7.0) - - GoogleMaps/Base (2.7.0) - - GoogleMaps/Maps (2.7.0): + - GoogleMaps (3.1.0): + - GoogleMaps/Maps (= 3.1.0) + - GoogleMaps/Base (3.1.0) + - GoogleMaps/Maps (3.1.0): - GoogleMaps/Base - - Mapbox-iOS-SDK (4.7.1) - - YandexMapKit (3.2.0): - - YandexRuntime (~> 3.2) - - YandexRuntime (3.2.0) + - Mapbox-iOS-SDK (5.1.0) + - YandexMapKit (3.3.1): + - YandexRuntime (~> 3.3) + - YandexRuntime (3.3.1) DEPENDENCIES: - ClusterKit/Mapbox (from `../.`) @@ -36,13 +36,13 @@ EXTERNAL SOURCES: :path: "../." SPEC CHECKSUMS: - ClusterKit: a15da2e7a437c525b18e10f007fd2198336e3e2e + ClusterKit: c744b85c508273e619e34917c46a07399437f208 GeoJSONSerialization: 55a3d24fe9af26508e3af76873114b39b13ba479 - GoogleMaps: f79af95cb24d869457b1f961c93d3ce8b2f3b848 - Mapbox-iOS-SDK: f9292a75e8cd5eb828f4432623bfc48aac42146a - YandexMapKit: 9bf046c69997348f07a37e587880bf18f147b8d3 - YandexRuntime: 1b2bf8365e5fec2fc91e9fda449fa7fae54b3d79 + GoogleMaps: 5c13302e6fe6bb6e686b267196586b91cd594225 + Mapbox-iOS-SDK: 4106f0f6808a0362233a703fb22369b3af3e9b8c + YandexMapKit: d91d278f55fa5cced0a946b9ba33431fb5a9665d + YandexRuntime: d7aae40396f41c9b23b17fee1fe6164b886e3679 PODFILE CHECKSUM: 8cd7d6fc523f40e53a12546f4b45c85894e2cf99 -COCOAPODS: 1.6.0 +COCOAPODS: 1.7.3