[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.
This commit is contained in:
committed by
GitHub
parent
7bfb9c9658
commit
2f0af0e8f4
@@ -1,6 +1,8 @@
|
||||
#import "MGLAccountManager_Private.h"
|
||||
#import "NSBundle+MGLAdditions.h"
|
||||
#if TARGET_OS_OSX
|
||||
#import "NSProcessInfo+MGLAdditions.h"
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
|
||||
#import "MGLMapboxEvents.h"
|
||||
@@ -40,9 +42,12 @@
|
||||
}
|
||||
|
||||
+ (instancetype)sharedManager {
|
||||
#if TARGET_OS_OSX
|
||||
if (NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) {
|
||||
return nil;
|
||||
}
|
||||
#endif
|
||||
|
||||
static dispatch_once_t onceToken;
|
||||
static MGLAccountManager *_sharedManager;
|
||||
void (^setupBlock)(void) = ^{
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 */,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1022,6 +1022,8 @@
|
||||
355BA4EC1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm */,
|
||||
405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */,
|
||||
405C03971DB0004E001AC280 /* NSImage+MGLAdditions.mm */,
|
||||
DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h */,
|
||||
DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m */,
|
||||
);
|
||||
name = Categories;
|
||||
sourceTree = "<group>";
|
||||
@@ -1121,8 +1123,6 @@
|
||||
352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */,
|
||||
3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */,
|
||||
1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */,
|
||||
DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h */,
|
||||
DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m */,
|
||||
DAE6C3821CC31E2A00DB3429 /* NSString+MGLAdditions.h */,
|
||||
DAE6C3831CC31E2A00DB3429 /* NSString+MGLAdditions.m */,
|
||||
DAED385D1D62CED700D7640F /* NSURL+MGLAdditions.h */,
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
"platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm",
|
||||
"platform/darwin/src/MGLPolygon.mm",
|
||||
"platform/darwin/src/MGLDistanceFormatter.m",
|
||||
"platform/darwin/src/NSProcessInfo+MGLAdditions.m",
|
||||
"platform/macos/src/NSProcessInfo+MGLAdditions.m",
|
||||
"platform/darwin/src/MGLFillExtrusionStyleLayer.mm",
|
||||
"platform/darwin/src/MGLOfflineStorage.mm",
|
||||
"platform/darwin/src/NSURL+MGLAdditions.m",
|
||||
@@ -177,7 +177,7 @@
|
||||
"MGLNetworkConfiguration_Private.h": "platform/darwin/src/MGLNetworkConfiguration_Private.h",
|
||||
"NSCompoundPredicate+MGLAdditions.h": "platform/darwin/src/NSCompoundPredicate+MGLAdditions.h",
|
||||
"MGLSymbolStyleLayer_Private.h": "platform/darwin/src/MGLSymbolStyleLayer_Private.h",
|
||||
"NSProcessInfo+MGLAdditions.h": "platform/darwin/src/NSProcessInfo+MGLAdditions.h",
|
||||
"NSProcessInfo+MGLAdditions.h": "platform/macos/src/NSProcessInfo+MGLAdditions.h",
|
||||
"MGLRendererFrontend.h": "platform/darwin/src/MGLRendererFrontend.h",
|
||||
"NSValue+MGLStyleAttributeAdditions.h": "platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h",
|
||||
"NSImage+MGLAdditions.h": "platform/macos/src/NSImage+MGLAdditions.h",
|
||||
|
||||
Reference in New Issue
Block a user