summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-10-15 14:14:52 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-10-22 14:27:39 -0700
commite3934df8d479153dee5694d7cab2776e9cfa1708 (patch)
tree74fb3763479b39a075fae1ce10bfe620c8ba8008 /include
parent0f866d9db603932ada3b339e5c8dde2b549a761a (diff)
downloadqtlocation-mapboxgl-e3934df8d479153dee5694d7cab2776e9cfa1708.tar.gz
[iOS] Replaced styleID property with styleURL__ inspectable
The new styleURL__ inspectable property is carefully named to masquerade as a URL property in Interface Builder, even though IB supports no such thing. If the user enters an invalid URL into the “Style URL” inspectable, throw an error instead of silently setting the style to the default. This check is not required in -setStyleURL:, which takes a real NSURL.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/ios/MGLMapView+IBAdditions.h6
-rw-r--r--include/mbgl/ios/MGLMapView.h8
2 files changed, 6 insertions, 8 deletions
diff --git a/include/mbgl/ios/MGLMapView+IBAdditions.h b/include/mbgl/ios/MGLMapView+IBAdditions.h
index 693457413f..ce50194993 100644
--- a/include/mbgl/ios/MGLMapView+IBAdditions.h
+++ b/include/mbgl/ios/MGLMapView+IBAdditions.h
@@ -11,7 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
// inspectables declared in MGLMapView.h are always sorted before those in
// MGLMapView+IBAdditions.h, due to ASCII sort order.
-@property (nonatomic, nullable) IBInspectable NSString *styleID;
+// HACK: We want this property to look like a URL bar in the Attributes
+// inspector, but just calling it styleURL would violate Cocoa naming
+// conventions and conflict with the existing NSURL property. Fortunately, IB
+// strips out the two underscores for display.
+@property (nonatomic, nullable) IBInspectable NSString *styleURL__;
// Convenience properties related to the initial viewport. These properties
// are not meant to be used outside of Interface Builder. latitude and longitude
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h
index e7f8446907..4506d30fb6 100644
--- a/include/mbgl/ios/MGLMapView.h
+++ b/include/mbgl/ios/MGLMapView.h
@@ -227,13 +227,7 @@ IB_DESIGNABLE
/** @name Styling the Map */
-/** Mapbox ID of the style currently displayed in the receiver, or `nil` if the style does not have an ID.
-*
-* The style may lack an ID if it is located at an HTTP, HTTPS, or local file URL. Use `styleURL` to get the URL in these cases.
-*
-* To display the default style, set this property to `nil`. */
-@property (nonatomic, nullable) NSString *styleID;
-@property (nonatomic, nullable) NSString *mapID __attribute__((unavailable("Use styleID.")));
+@property (nonatomic, nullable) NSString *styleID __attribute__((unavailable("Set styleURL to an NSURL of the form <mapbox://styles/STYLE_ID>, where STYLE_ID would have been the value of this property.")));
/** URLs of the styles bundled with the library. */
@property (nonatomic, readonly) NS_ARRAY_OF(NSURL *) *bundledStyleURLs;