summaryrefslogtreecommitdiff
path: root/gyp
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-04-01 15:57:36 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-04-03 12:16:00 -0700
commitda13225a816ca40b8be209639c8ad0dc67681089 (patch)
tree229c4bebc244c6ecc396dd5931dc97db51eccb8b /gyp
parente18e4b0de5f601cdfb07eed209e64f88a114e492 (diff)
downloadqtlocation-mapboxgl-da13225a816ca40b8be209639c8ad0dc67681089.tar.gz
Made MGLMapView designable in IB
When an access token is set in the Attributes inspector (or as a user-defined runtime attribute), we draw some lovely Mapbox branding so the view shows up. (Manipulating invisible rectangles is a frustrating exercise, I’m told.) In the absence of an access token, the view displays a helpful message with directions for obtaining and setting the access token. Along the way, completely opt out of `MGLMapboxEvents` when targeting Interface Builder, because touching Core Location throws an exception in that environment and it doesn’t make sense to record any metrics when designing on the Interface Builder canvas. Also, don’t start `mbgl::Map` at all (and don’t update it) because none of the runtime drawing code should ever be run in the designable. Normally these chunks of code would be excluded in IB using the TARGET_INTERFACE_BUILDER preprocessor macro. However, Mapbox GL is being packaged as a static library, so the macro is only evaluated when the library is prebuilt, even if the library eventually makes its way into the CocoaPods-generated framework. Instead, we detect that we’re being run by the IBDesignablesAgentCocoaTouch process. Overrode `-[MGLMapView initWithFrame:]` to call `-commonInit`. We’ve marked this initializer unavailable in the header, but IB still calls it regardless. Fixes #929.
Diffstat (limited to 'gyp')
-rw-r--r--gyp/platform-ios.gypi2
1 files changed, 2 insertions, 0 deletions
diff --git a/gyp/platform-ios.gypi b/gyp/platform-ios.gypi
index fc6771d83a..998a0d1b8f 100644
--- a/gyp/platform-ios.gypi
+++ b/gyp/platform-ios.gypi
@@ -30,6 +30,8 @@
'../include/mbgl/ios/MGLMetricsLocationManager.h',
'../platform/ios/MGLMetricsLocationManager.m',
'../include/mbgl/ios/MGLTypes.h',
+ '../platform/ios/NSProcessInfo+MGLAdditions.h',
+ '../platform/ios/NSProcessInfo+MGLAdditions.m',
'../platform/ios/NSString+MGLAdditions.h',
'../platform/ios/NSString+MGLAdditions.m',
'../platform/ios/vendor/SMCalloutView/SMCalloutView.h',