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

iOS immediate style 😎 - #6018

Merged
incanus merged 1 commit into
masterfrom
5957-ios-immediate-style
Aug 16, 2016
Merged

incanus merged 1 commit into
masterfrom
5957-ios-immediate-style

Conversation

@incanus

@incanus incanus commented Aug 15, 2016 •

Copy link
Copy Markdown
Contributor

Fixes #5957 by introducing an automatic call to -[MGLBaseStyleLayer update] for all setters.

#6017 tracks a more efficient transaction block mechanism, which doesn't necessarily have to be a part of the same release.

/cc @frederoni @1ec5

@incanus incanus added feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling labels Aug 15, 2016
@incanus incanus added this to the ios-v3.4.0 milestone Aug 15, 2016
@incanus incanus self-assigned this Aug 15, 2016
@mention-bot

Copy link
Copy Markdown

@incanus, thanks for your PR! By analyzing this pull request, we identified @1ec5, @friedbunny and @boundsj to be potential reviewers.

@1ec5

1ec5 commented Aug 15, 2016

Copy link
Copy Markdown
Contributor

There should no longer be a use case for calling -[MGLBaseStyleLayer update], so that method should be made private.

@incanus

incanus commented Aug 15, 2016

Copy link
Copy Markdown
Contributor Author

Ok, attempted -update privacy in 8f98d83 @1ec5. Curious about your thoughts on whether we should have a separate MGLBaseStyleLayer_Private.hpp for this or if this suffices. I originally tried something with an additionally protocol that the child layer types could adopt, but that doesn't allow them to call back to super's implementation, but rather warns that they don't implement it themselves.

@1ec5

1ec5 commented Aug 15, 2016 •

Copy link
Copy Markdown
Contributor

MGLBaseStyleLayer_Private should go in a separate MGLBaseStyleLayer_Private.h file. Also, note that I’m about to go through and rename the .hpp files to .h: #5952.

@incanus

incanus commented Aug 16, 2016 •

Copy link
Copy Markdown
Contributor Author

Feel good about this then @1ec5 @frederoni? If so I'll squash & merge. I think it's in 👌 shape.

@1ec5

1ec5 commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

Looks good. Interesting that no change was needed in MapDocument.m. I take that as evidence that developers would likely forget to call -update, so this is a good API change to make.

@frederoni

Copy link
Copy Markdown
Contributor

Adding/removing a source or a layer also recalculates styles and classes, that's why no -update call was needed in MapDocument.m

This looks good to me 👍

@incanus
incanus force-pushed the 5957-ios-immediate-style branch from bb9652d to 01b94de Compare August 16, 2016 18:30
@incanus
incanus merged commit 01b94de into master Aug 16, 2016
@incanus

incanus commented Aug 16, 2016

Copy link
Copy Markdown
Contributor Author

Dang, keep forgetting the [ios]; sorry about that. Next time!

@incanus
incanus deleted the 5957-ios-immediate-style branch August 16, 2016 18:32
@1ec5

1ec5 commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

MGLBaseStyleLayer_Private.hpp wasn’t added to ios.xcodeproj or macos.xcodeproj. The projects build, because it was only included privately anyways, but we should add it to the projects.

@1ec5

1ec5 commented Aug 16, 2016

Copy link
Copy Markdown
Contributor

MGLBaseStyleLayer_Private.hpp wasn’t added to ios.xcodeproj or macos.xcodeproj.

Fixed in #6020.

@incanus

incanus commented Aug 16, 2016

Copy link
Copy Markdown
Contributor Author

Oh weird; I didn't realize we did this manually now vs. getting picked up by the build system based on location and file extension.

@1ec5

1ec5 commented Aug 17, 2016 •

Copy link
Copy Markdown
Contributor

CMake does automatically pull core files into the project it generates, but the SDK-level projects are checked into the repository (#3275), so we use the standard Xcode workflow for that. Feel free to use Xcode’s New File sheet etc.

@kkaefer

kkaefer commented Aug 17, 2016

Copy link
Copy Markdown
Member

CMake does automatically pull core files into the project it generates

No, it doesn't. If you add/remove files, we have a convenience script at ./scripts/generate-core-files.sh and ./scripts/generate-test/files.sh that updates the list.

@1ec5

1ec5 commented Aug 18, 2016 •

Copy link
Copy Markdown
Contributor

I stand corrected. 😀 That's actually better than what we had with GYP, because we had to manually add SDK files to the .gypi file. With GYP, it was only automatic based on the file extension and location for core files (?) and for SDK resource files. But never for SDK source files or headers, because Xcode's build system doesn't support target membership based on folder references.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants