-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Deactivate MGLMapView IBDesignable #13802
Conversation
|
Removed the 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.
c060996
to
9922073
Compare
@friedbunny you are right. I got confused, I changed accordingly. |
@@ -159,7 +159,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLResourceNotFoundException | |||
See the <a href="https://www.mapbox.com/ios-sdk/maps/examples/simple-map-view/"> | |||
Simple map view</a> example to learn how to initialize a basic `MGLMapView`. | |||
*/ | |||
MGL_EXPORT IB_DESIGNABLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing IB_DESIGNABLE
will stop it from working, but evidently doesn’t remove any code from the shipped framework — are the opportunities here to conditionally remove code (and thus marginally reduce binary size)?
@@ -288,7 +288,6 @@ @implementation MGLMapView | |||
/// True if a willChange notification has been issued for shape annotation layers and a didChange notification is pending. | |||
BOOL _isChangingAnnotationLayers; | |||
BOOL _isWaitingForRedundantReachableNotification; | |||
BOOL _isTargetingInterfaceBuilder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this, but set it to NO
(rather than calling NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent
) on an #ifdef (like you had previously).
Then you could keep the existing code that uses _isTargetingInterfaceBuilder
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason to remove this is that IBDesignable
does provide a little value to MGLMapView
, the only changes you can see in IB is the ornaments. Removing this code is a sign that we won't support it and we remove the unusable code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
We should still periodically check to see if the issue has been fixed on Xcode's side. Perhaps this is better done with a sample project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only changes you can see in IB is the ornaments
As illustrated in #929, the main reason we added a designable was because it’s very awkward to work with a custom view in IB: it ends up as an invisible rectangle. We also took advantage of the designable to remind the developer to set the access token; it’s gentler than asserting at launch.
We should still periodically check to see if the issue has been fixed on Xcode's side. Perhaps this is better done with a sample project.
Yes, especially now that Xcode 10.2 is in beta. Make sure to test both CocoaPods and Carthage. For what it’s worth, in Xcode 10.1 with the iOS navigation SDK installed via Carthage, the designable appears in a split-second, even in a launch storyboard.
For some reason |
Fixes #13424