diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2019-04-10 13:01:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-10 13:01:59 -0700 |
commit | 2f0af0e8f4e1f0fc0dbc4a6b13ab2f098adad0af (patch) | |
tree | 69c01c248136ba2c9a80cc8900e2a697acffb3d7 /platform/ios | |
parent | 7bfb9c9658f00b5745fb8aea44b1224278b3190e (diff) | |
download | qtlocation-mapboxgl-2f0af0e8f4e1f0fc0dbc4a6b13ab2f098adad0af.tar.gz |
[ios] Deactivate MGLMapView IBDesignable (#14379)
Removed MGLMapView's IBDesignable attribute. The map's view render attributes
uses GL, making changes through the inspectables were not reflected in the storyboard
and were causing IB crashes.
* [ios] Deactivate MGLMapView IBDesignable.
* [ios] Remove IBDesignable agent code.
* [ios, macos] Remove NSProcessInfo category from iOS.
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/CHANGELOG.md | 1 | ||||
-rw-r--r-- | platform/ios/ios.xcodeproj/project.pbxproj | 10 | ||||
-rw-r--r-- | platform/ios/sdk-files.json | 2 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.h | 2 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 13 | ||||
-rw-r--r-- | platform/ios/src/MGLMapboxEvents.m | 4 | ||||
-rw-r--r-- | platform/ios/src/MGLSDKUpdateChecker.mm | 4 |
7 files changed, 7 insertions, 29 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e15815332c..0c4ed5870d 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -5,6 +5,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ## 4.11.0 * No public-facing changes in v4.11.0-alpha.1. +* Fixed an Interface Builder crash when using an `MGLMapView` in a storyboard. ([#14379](https://github.com/mapbox/mapbox-gl-native/pull/14379)) ## 4.10.0 diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 2d4db74493..958812866a 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -609,8 +609,6 @@ DA88482C1CBAFA6200AB86E3 /* NSBundle+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848121CBAFA6200AB86E3 /* NSBundle+MGLAdditions.h */; }; DA88482D1CBAFA6200AB86E3 /* NSBundle+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848131CBAFA6200AB86E3 /* NSBundle+MGLAdditions.m */; }; DA88482E1CBAFA6200AB86E3 /* NSException+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848141CBAFA6200AB86E3 /* NSException+MGLAdditions.h */; }; - DA88482F1CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848151CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h */; }; - DA8848301CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848161CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m */; }; DA8848311CBAFA6200AB86E3 /* NSString+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848171CBAFA6200AB86E3 /* NSString+MGLAdditions.h */; }; DA8848321CBAFA6200AB86E3 /* NSString+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848181CBAFA6200AB86E3 /* NSString+MGLAdditions.m */; }; DA88483A1CBAFB8500AB86E3 /* MGLAnnotationImage.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848341CBAFB8500AB86E3 /* MGLAnnotationImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -660,7 +658,6 @@ DAA4E4271CBB730400178DFB /* MGLTilePyramidOfflineRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8848101CBAFA6200AB86E3 /* MGLTilePyramidOfflineRegion.mm */; }; DAA4E4281CBB730400178DFB /* MGLTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848111CBAFA6200AB86E3 /* MGLTypes.m */; }; DAA4E4291CBB730400178DFB /* NSBundle+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848131CBAFA6200AB86E3 /* NSBundle+MGLAdditions.m */; }; - DAA4E42A1CBB730400178DFB /* NSProcessInfo+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848161CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m */; }; DAA4E42B1CBB730400178DFB /* NSString+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848181CBAFA6200AB86E3 /* NSString+MGLAdditions.m */; }; DAA4E42D1CBB730400178DFB /* MGLAnnotationImage.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848411CBAFB9800AB86E3 /* MGLAnnotationImage.m */; }; DAA4E42F1CBB730400178DFB /* MGLCompactCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848451CBAFB9800AB86E3 /* MGLCompactCalloutView.m */; }; @@ -1320,8 +1317,6 @@ DA8848121CBAFA6200AB86E3 /* NSBundle+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+MGLAdditions.h"; sourceTree = "<group>"; }; DA8848131CBAFA6200AB86E3 /* NSBundle+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+MGLAdditions.m"; sourceTree = "<group>"; }; DA8848141CBAFA6200AB86E3 /* NSException+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSException+MGLAdditions.h"; sourceTree = "<group>"; }; - DA8848151CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSProcessInfo+MGLAdditions.h"; sourceTree = "<group>"; }; - DA8848161CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSProcessInfo+MGLAdditions.m"; sourceTree = "<group>"; }; DA8848171CBAFA6200AB86E3 /* NSString+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MGLAdditions.h"; sourceTree = "<group>"; }; DA8848181CBAFA6200AB86E3 /* NSString+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MGLAdditions.m"; sourceTree = "<group>"; }; DA8848341CBAFB8500AB86E3 /* MGLAnnotationImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationImage.h; sourceTree = "<group>"; }; @@ -2339,8 +2334,6 @@ 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */, 35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */, 1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */, - DA8848151CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h */, - DA8848161CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m */, DA8848171CBAFA6200AB86E3 /* NSString+MGLAdditions.h */, DA8848181CBAFA6200AB86E3 /* NSString+MGLAdditions.m */, DAED38611D62D0FC00D7640F /* NSURL+MGLAdditions.h */, @@ -2545,7 +2538,6 @@ 359F57461D2FDDA6005217F1 /* MGLUserLocationAnnotationView_Private.h in Headers */, 404C26E21D89B877000AA13D /* MGLTileSource.h in Headers */, DA8847FD1CBAFA5100AB86E3 /* MGLTilePyramidOfflineRegion.h in Headers */, - DA88482F1CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h in Headers */, DA8848601CBAFC2E00AB86E3 /* Mapbox.h in Headers */, DAF0D8101DFE0EA000B28378 /* MGLRasterTileSource_Private.h in Headers */, 350098BB1D480108004B2AF0 /* MGLVectorTileSource.h in Headers */, @@ -3311,7 +3303,6 @@ 40834C471FE05F7500C1BD0D /* TSKReportsRateLimiter.m in Sources */, 966FCF4E1F3A5C9200F2B6DE /* MGLUserLocationHeadingBeamLayer.m in Sources */, 8989B17E201A48EB0081CF59 /* MGLHeatmapStyleLayer.mm in Sources */, - DA8848301CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m in Sources */, 40834BED1FE05E1800C1BD0D /* MMEEventLogger.m in Sources */, 353AFA161D65AB17005A69F4 /* NSDate+MGLAdditions.mm in Sources */, 1FCAE2A420B872A400C577DD /* MGLLocationManager.m in Sources */, @@ -3454,7 +3445,6 @@ 35D13AC61D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */, 1FCAE2A520B872A400C577DD /* MGLLocationManager.m in Sources */, 40834C031FE05E1800C1BD0D /* MMEEventsManager.m in Sources */, - DAA4E42A1CBB730400178DFB /* NSProcessInfo+MGLAdditions.m in Sources */, DAA4E4211CBB730400178DFB /* MGLOfflineStorage.mm in Sources */, 4049C2A01DB6CD6C00B3F799 /* MGLPointCollection.mm in Sources */, 35136D401D42273000C20EFD /* MGLLineStyleLayer.mm in Sources */, diff --git a/platform/ios/sdk-files.json b/platform/ios/sdk-files.json index 26dad2c277..eadac1424b 100644 --- a/platform/ios/sdk-files.json +++ b/platform/ios/sdk-files.json @@ -111,7 +111,6 @@ "platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKReportsRateLimiter.m", "platform/ios/src/MGLUserLocationHeadingBeamLayer.m", "platform/darwin/src/MGLHeatmapStyleLayer.mm", - "platform/darwin/src/NSProcessInfo+MGLAdditions.m", "platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogger.m", "platform/darwin/src/NSDate+MGLAdditions.mm", "platform/darwin/src/MGLLocationManager.m", @@ -284,7 +283,6 @@ "MGLTileSource_Private.h": "platform/darwin/src/MGLTileSource_Private.h", "MGLFaux3DUserLocationAnnotationView.h": "platform/ios/src/MGLFaux3DUserLocationAnnotationView.h", "MGLUserLocationAnnotationView_Private.h": "platform/ios/src/MGLUserLocationAnnotationView_Private.h", - "NSProcessInfo+MGLAdditions.h": "platform/darwin/src/NSProcessInfo+MGLAdditions.h", "MGLRasterTileSource_Private.h": "platform/darwin/src/MGLRasterTileSource_Private.h", "MGLFeature_Private.h": "platform/darwin/src/MGLFeature_Private.h", "MGLRendererConfiguration.h": "platform/darwin/src/MGLRendererConfiguration.h", diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 589b7b547b..607a197840 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -179,7 +179,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLResourceNotFoundException See the <a href="https://docs.mapbox.com/ios/maps/examples/simple-map-view/"> Simple map view</a> example to learn how to initialize a basic `MGLMapView`. */ -MGL_EXPORT IB_DESIGNABLE +MGL_EXPORT @interface MGLMapView : UIView #pragma mark Creating Instances diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 8bfd161cdb..232beb9b2e 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -48,7 +48,6 @@ #import "NSDate+MGLAdditions.h" #import "NSException+MGLAdditions.h" #import "NSPredicate+MGLPrivateAdditions.h" -#import "NSProcessInfo+MGLAdditions.h" #import "NSString+MGLAdditions.h" #import "NSURL+MGLAdditions.h" #import "UIDevice+MGLAdditions.h" @@ -299,7 +298,6 @@ public: /// True if a willChange notification has been issued for shape annotation layers and a didChange notification is pending. BOOL _isChangingAnnotationLayers; BOOL _isWaitingForRedundantReachableNotification; - BOOL _isTargetingInterfaceBuilder; CLLocationDegrees _pendingLatitude; CLLocationDegrees _pendingLongitude; @@ -404,14 +402,12 @@ public: } NSString *styleURLString = @(self.mbglMap.getStyle().getURL().c_str()).mgl_stringOrNilIfEmpty; - MGLAssert(styleURLString || _isTargetingInterfaceBuilder, @"Invalid style URL string %@", styleURLString); + MGLAssert(styleURLString, @"Invalid style URL string %@", styleURLString); return styleURLString ? [NSURL URLWithString:styleURLString] : nil; } - (void)setStyleURL:(nullable NSURL *)styleURL { - if (_isTargetingInterfaceBuilder) return; - if ( ! styleURL) { styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; @@ -446,7 +442,6 @@ public: - (void)commonInit { - _isTargetingInterfaceBuilder = NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent; _opaque = NO; _atLeastiOS_12_2_0 = [NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){12,2,0}]; @@ -501,7 +496,7 @@ public: _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, *_mbglThreadPool, mapOptions, resourceOptions); // start paused if in IB - if (_isTargetingInterfaceBuilder || background) { + if (background) { self.dormant = YES; } @@ -1006,7 +1001,7 @@ public: [self adjustContentInset]; - if (!_isTargetingInterfaceBuilder && _mbglMap) { + if (_mbglMap) { self.mbglMap.setSize([self size]); } @@ -5341,7 +5336,7 @@ public: - (void)setShowsUserLocation:(BOOL)showsUserLocation { MGLLogDebug(@"Setting showsUserLocation: %@", MGLStringFromBOOL(showsUserLocation)); - if (showsUserLocation == _showsUserLocation || _isTargetingInterfaceBuilder) return; + if (showsUserLocation == _showsUserLocation) return; _showsUserLocation = showsUserLocation; diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index 0635f974e1..eabd970edb 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -1,6 +1,5 @@ #import "MGLMapboxEvents.h" #import "NSBundle+MGLAdditions.h" -#import "NSProcessInfo+MGLAdditions.h" static NSString * const MGLAPIClientUserAgentBase = @"mapbox-maps-ios"; static NSString * const MGLMapboxAccountType = @"MGLMapboxAccountType"; @@ -32,9 +31,6 @@ static NSString * const MGLVariableGeofence = @"VariableGeofence"; } + (nullable instancetype)sharedInstance { - if (NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) { - return nil; - } static dispatch_once_t onceToken; static MGLMapboxEvents *_sharedInstance; diff --git a/platform/ios/src/MGLSDKUpdateChecker.mm b/platform/ios/src/MGLSDKUpdateChecker.mm index c41fc51ac5..cfea139bdb 100644 --- a/platform/ios/src/MGLSDKUpdateChecker.mm +++ b/platform/ios/src/MGLSDKUpdateChecker.mm @@ -1,14 +1,12 @@ #import "MGLSDKUpdateChecker.h" #import "NSBundle+MGLAdditions.h" -#import "NSProcessInfo+MGLAdditions.h" @implementation MGLSDKUpdateChecker + (void)checkForUpdates { #if TARGET_IPHONE_SIMULATOR // Abort if running in a playground. - if ([[NSBundle mainBundle].bundleIdentifier hasPrefix:@"com.apple.dt.playground."] || - NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) { + if ([[NSBundle mainBundle].bundleIdentifier hasPrefix:@"com.apple.dt.playground."]) { return; } |