Announcing Version 4.0 of the Maps and Places SDKs for iOS
Today, we released new versions of Maps and Places SDKs for iOS. With version 4.0, both SDKs now support apps for devices running a minimum version of iOS 10 and the Places SDK got a handful of improvements providing a more intuitive API and better support for Swift developers.
Dropping support for older versions and devices requires careful consideration—it’s something we don’t take lightly. On the other hand, increasing the minimum version improves developer velocity as it’s one less version to test against. Having over 99% of our customers’ users on iOS 10 or later served as a good signal to increase the minimum for this major version release. While we always recommend that you adopt the latest version of our SDKs, should your use case require you to support iOS 9, we still support Versions 3.x (Maps, Places) of our SDKs.
Improved Swift support
Fetching multiple fields when obtaining Place details requires combining
GMSPlaceField types. Before Places SDK for iOS 4.0, combining fields in Swift required either force unwrapping, or conditional unwrapping, giving it the impression that combining certain types is unsafe.
For example, having name and Place ID in the same field might look like this:
The above syntax was previously required since GMSPlaceField was declared as an NS_ENUM. With Places SDK for iOS v4.0, we’ve updated GMSPlaceField to an NS_OPTIONS enabling you to use an array literal when combining fields which is a more familiar syntax in Swift.
Rewriting the above code snippet would now look like this:
Beginning with version 4.0, the Places SDK for iOS ends support of a handful of deprecated APIs in favor of alternatives:
GMSPlacewas removed. To obtain this status, use the field
openingHourswhich contains more information about a place’s opening hours.
initWithBounds:filter:was removed in favor of
boundsModewere removed from
GMSAutocompleteTableDataSourcein favor of the
locationRestrictionvalues in the
The deprecated helper method
GMSAutocompleteTableDataSourcehave been removed in favor of setting the value of
The deprecated helper methods in
findAutocompletePredictionsFromQuery:bounds:boundsMode:filter:sessionToken:callback:have been removed in favor of
To continue using the old methods, be sure to specify a version lower than 4.0 until you are ready to update your code to use the replacement properties.
Install version 4.0 and check out our samples
You can now install version 4.0 of the Maps and Places SDK for iOS through CocoaPods or Carthage. We also recommend that you use Xcode 11.7 or later for this version of the SDK. To get a tour of our SDKs, make sure to check out our Swift and Objective-C samples as well as the Maps for iOS Utility Library.
For more information on Google Maps Platform, visit our website.
Related Google News:
- Announcing the 12 remarkable innovators selected for the upcoming Google for Startups… February 22, 2021
- Improvements for locating new comments and important conversations in Google Docs February 22, 2021
- Fostering innovation in the Middle East, Turkey and Africa February 22, 2021
- Architect your data lake on Google Cloud with Data Fusion and Composer February 19, 2021
- New option to download third-party apps and domain wide delegation to CSV February 18, 2021
- Changes to information visibility in Meet quality tool, Meet audit log, and Reports API February 18, 2021
- Basis Universal Textures - Khronos Ratification and Support February 18, 2021
- New in Google Cloud VMware Engine: improved reach, networking and scale February 18, 2021