iOS 版 Places Swift SDK
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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 的主要功能包括:
iOS 適用的 Places Swift SDK 僅適用於 Places SDK for iOS (新版) API,其中包含下列產品:
從 Places SDK for iOS 遷移至 Places Swift SDK for iOS
Places Swift SDK for iOS 程式碼可與舊版實作項目並行運作,因此您可以逐步完成遷移作業。
如要瞭解詳情及如何遷移至新版 SDK,請參閱遷移指南。
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間: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)"]]