-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Upgrading from Mapbox Maps SDK for iOS v3.7.x to v4.0.x
Mapbox Maps SDK for iOS v4.0.0 is the first major version of this SDK since 2015. To upgrade, follow the installation instructions, or run pod update
with CocoaPods or carthage update
with Carthage.
Version 4.0.0 contains a number of important changes. There are several backwards-incompatible changes to be aware of as you upgrade, which are discussed below.
We made a number of improvements to give you more control over the appearance of a map’s style. These improvements required us to make the following backwards-incompatible API changes to MGLStyleLayer
and its subclasses:
- The layout and paint properties on subclasses of
MGLStyleLayer
are now of typeNSExpression
instead ofMGLStyleValue
.MGLStyleValue
has been removed. This guide shows you how to migrate your runtime styling code toNSExpression
. The “Predicates and Expressions” guide contains full details on how to write expressions that are compatible with style layers. - A small number of
NSPredicate
s written for v3.7.x may need to cast feature attributes to the correct type, as described in this section of the predicate guide.
You’ll need to account for the following renamed APIs. Xcode automatically provides fix-it suggestions wherever your code needs to change:
Old | New | Languages affected |
---|---|---|
MGLRasterSource |
MGLRasterTileSource |
Objective-C and Swift |
MGLVectorSource |
MGLVectorTileSource |
Objective-C and Swift |
MGLStyle.streetsStyleURL() etc. |
MGLStyle.streetsStyleURL etc. |
Swift only |
MGLOfflineStorage.shared() |
MGLOfflineStorage.shared |
Swift only |
MGLAccountManager.setAccessToken("pk.…") |
MGLAccountManager.accessToken = "pk.…" |
Swift only |
Any classes, methods, or properties that were deprecated in v3.7.6 are no longer available. See your project’s build errors for details about replacements.
The SDK no longer supports 32-bit simulators, such as the iPhone 5 and iPad 2 simulators. The SDK continues to support 32-bit devices, but note that the minimum iOS deployment version will increase to iOS 9.0 in a future release.
If you have any questions, please contact Mapbox’s support team.
Workflow: Code, Makefile, CMake, Xcode, ccache, Debugging, CI, JS/Native, Code Generation, Versions & Tagging, Contributing, Troubleshooting
Architecture: Threads, Immutability, Expressions, Text Rendering, Collision Detection, CJK Text
Rendering: OpenGL, Coordinate Systems
Android: checkstyle, APK Size, 4→5, 5→6, 6→7, Symbolication
iOS/macOS: 3→4
Releasing: iOS, macOS, Merging back
Misc: Terminology