Places Swift SDK for iOS
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Places Swift SDK for iOS 提供 Places SDK for iOS SDK 的 Swift 优先版本。Places Swift SDK for iOS 提供与 Places SDK for iOS 相同的全部功能,并直接在 Swift 中实现,因此还具有许多额外优势。这些优势利用了 Swift 的独特特性,因此有助于编写更符合 Swift 编程习惯的代码。
Places Swift SDK 的主要功能包括:
Places Swift SDK for iOS 仅在 Places SDK for iOS(新)API 中提供,后者包含以下产品:
从 Places SDK for iOS 迁移到 Places Swift SDK for iOS
Places Swift SDK for iOS 代码可与旧版实现并行运行,因此您可以逐步完成迁移。
如需了解详情以及如何迁移到新版 SDK,请查看迁移指南。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003ePlaces Swift SDK for iOS (Preview) offers a Swift-native experience with benefits like value types, default parameters, optionals, concurrency support, and improved type safety, built upon the existing Places SDK for iOS.\u003c/p\u003e\n"],["\u003cp\u003eIt's currently in preview mode and exclusively available for new Places SDK for iOS APIs, including Place Autocomplete, Details, Photos, Text Search, and Nearby Search.\u003c/p\u003e\n"],["\u003cp\u003eMigration from the existing Places SDK for iOS can be done incrementally as the new Swift SDK works alongside older implementations.\u003c/p\u003e\n"],["\u003cp\u003eThe GitHub URL for Places Swift SDK for iOS (Preview) has been updated to \u003ca href=\"https://github.com/googlemaps/ios-places-sdk\"\u003ehttps://github.com/googlemaps/ios-places-sdk\u003c/a\u003e, replacing the previous URL.\u003c/p\u003e\n"]]],[],null,["# Places Swift SDK for iOS\n\n\u003cbr /\u003e\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nPlaces Swift SDK for iOS provides a Swift-first version of the\nPlaces SDK for iOS SDK. Places Swift SDK for iOS\noffers all the same capabilities that users are familiar with from the\nPlaces SDK for iOS, with many added benefits gained from\nbeing implemented directly in Swift. These benefits make use of Swift's unique\nqualities, and therefore promote writing more idiomatic Swift code.\n\nKey features of the Places Swift SDK include:\n\n- Extensive use of [value\n types](https://www.swift.org/documentation/articles/value-and-reference-types.html), [default parameter\n values](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Default-Parameter-Values), and [optionals](https://developer.apple.com/documentation/swift/optional)\n- Support for Swift concurrency.\n- Improved type-safety.\n\nPlaces Swift SDK for iOS is available exclusively in the\nPlaces SDK for iOS (New) APIs, which are comprised of the\nfollowing products:\n\n- [Place Autocomplete (New)](/maps/documentation/places/ios-sdk/place-autocomplete)\n- [Place Details (New)](/maps/documentation/places/ios-sdk/details-place)\n- [Places UI Kit](/maps/documentation/places/ios-sdk/places-ui-kit-overview)\n- [Place Photos (New)](/maps/documentation/places/ios-sdk/place-photos)\n- [Text Search (New)](/maps/documentation/places/ios-sdk/text-search)\n- [Nearby Search (New)](/maps/documentation/places/ios-sdk/nearby-search)\n\nMigrate from the Places SDK for iOS to the Places Swift SDK for iOS\n-------------------------------------------------------------------\n\nPlaces Swift SDK for iOS code works alongside older implementations,\nso your migration can be done incrementally.\n\nFor more information, and to learn how to migrate to the new SDK, [review the\nmigration guide](/maps/documentation/places/ios-sdk/migrate-places-sdk).\n| **Note:** The URL to access Places Swift SDK for iOS has changed. It is now \u003chttps://github.com/googlemaps/ios-places-sdk\u003e. If you have been using the previous URL (https://github.com/googlemaps/ios-places-swift-sdk), remove that GitHub URL from your Xcode package dependencies and enter the updated one.\n|\n|\n| If you try to add `GooglePlacesSwift` from a deprecated repository, you will see\n| the following error message: `Failed to resolve dependencies Dependencies could\n| not be resolved because no versions of 'ios-places-swift-sdk' match the\n| requirement 0.2.0 and root depends on 'ios-places-swift-sdk' 0.2.0.`\n|\n|\n| See [the installation page](/maps/documentation/places/ios-sdk/config) for more\n| information.\n\nNext steps\n----------\n\n- Learn [how to enable the Places SDK for iOS](/maps/documentation/places/ios-sdk/config#googleplacesswift) and start using Places Swift SDK for iOS.\n- Review the [Places Swift SDK for iOS API\n Reference](/maps/documentation/places/ios-sdk/reference/swift/Classes).\n- See the [release notes for Places Swift SDK for iOS](/maps/documentation/places/ios-sdk/places-swift-release-notes)"]]