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/src/MGLMapView.mm | |
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/src/MGLMapView.mm')
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 13 |
1 files changed, 4 insertions, 9 deletions
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; |