Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Support XIBs and storyboards on iOS #1070

Closed
2 tasks
1ec5 opened this issue Mar 23, 2015 · 2 comments · Fixed by #1184
Closed
2 tasks

Support XIBs and storyboards on iOS #1070

1ec5 opened this issue Mar 23, 2015 · 2 comments · Fixed by #1184
Assignees
Labels
iOS Mapbox Maps SDK for iOS
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Mar 23, 2015

It’s relatively difficult to add an MGLMapView to a storyboard-based project. As expected, you can drag a UIView into a scene and set its custom class to “MGLMapView”. However, that just gets you a blank map. So you need to call [mapView setAccessToken:@"…"] at launch, and [mapView setStyleJSON:nil] sometime after that, but not too soon or you’ll hit #1014.

Basic support for XIBs and storyboards means:

After we get basic support, we can look at enhancing the IB workflow via #929.

@1ec5 1ec5 added the iOS Mapbox Maps SDK for iOS label Mar 23, 2015
@1ec5 1ec5 added this to the iOS Beta 2 milestone Mar 23, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Mar 30, 2015

We plan to distribute Mapbox GL via CocoaPods (#1030), which handles repackaging the library as a dynamic framework when use_frameworks! is specified (required for Swift usage). That unblocks #929, so we could in principle ship with an inspectable and designable MGLMapView today. However, we need accessToken to be KVO-compliant and trigger a refresh (without hitting #1147) in order to provide the right developer experience.

@1ec5 1ec5 self-assigned this Mar 30, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Mar 30, 2015

This is definitely blocked on #1147.

1ec5 added a commit that referenced this issue Mar 30, 2015
mbgl::Map is now started on demand, once either the access token or a bundled style name is set. The access token and style name are exposed to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable!

Ref #1070, #1147
1ec5 added a commit that referenced this issue Apr 3, 2015
`Map` should be able to deal with having no access token or JSON even while it’s running. Most of `Map` accounts for this situation, but `reloadStyle()` incorrectly assumes that one or the other is set. This change corrects the assumption in `reloadStyle()`.

Also expose the access token and style name to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable!

Ref #1070, #1147
@1ec5 1ec5 closed this as completed in #1184 Apr 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant