The GooglePlacesDemos folder contains a comprehensive demo application showcasing various features of the Places Swift SDK for iOS. Built with SwiftUI, it demonstrates modern iOS development practices while implementing key Places SDK functionality.
The demo app includes several sample implementations:
- Address Autocomplete Form with integrated map view
- Place Details Card showing business information, hours, and ratings
- Places Search with text and nearby location options
- Place Photos integration and management
- Places Autocomplete with custom SwiftUI interface
- Interactive map integration using Google Maps SDK
- Xcode 16.2 or later with iOS SDK 17.0 or later
- iOS Simulator or device running iOS 17+
- API keys from Google Cloud with the following APIs enabled:
- Swift and SwiftUI knowledge
-
Set up a Google Cloud project and enable the Places API (New) and Maps API's.
-
Clone this repository
git clone [email protected]:googlemaps-samples/ios-places-sdk-samples.git -
Change into the
GooglePlacesDemosfoldercd ios-places-sdk-samples/GooglePlacesDemos -
Open GooglePlacesDemos.xcodeproj to open the project in Xcode.
open GooglePlacesDemos.xcodeproj/ -
Create a local configuration file for your API key in the same directory (
GooglePlacesDemos/GooglePlacesDemos) as the demo application's "Info.plist" file. Name the file "GooglePlacesDemos.xcconfig". This will not be checked into source control since.xcconfigis on the.gitignorelist. -
Add two lines to
GooglePlacesDemos.xcconfigfor setting the values of your API keys. Substitute the "YOUR_PLACES_API_KEY" and "YOUR_MAPS_API_KEY" in the snippet below with the API keys from Step 1.PLACES_API_KEY = "YOUR_PLACES_API_KEY" MAPS_API_KEY = "YOUR_MAPS_API_KEY"This should be enough for the demo app to retrieve your key to use for requests. (See https://help.apple.com/xcode/#/dev745c5c974 for more information about xcconfig files.)
- Built with SwiftUI and MVVM design pattern
- Uses
ObservableObjectview models for state management - Custom SwiftUI wrapper for Google Maps integration
- Modular components for reusability
PlaceDetailsManager- Handles place details data fetching and stateGoogleMapView- SwiftUI wrapper for GMSMapViewPlaceDetailsCard- A reusable SwiftUI view component that displays formatted Place information including:- Business name and rating
- Opening hours and current status
- Price level and business type
- Rating stars visualization
- Support for editorial summary
Please see CONTRIBUTING.md.
This repository uses Google Maps Platform services. Use of Google Maps Platform services through this library is subject to the Google Maps Platform Terms of Service.
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 will apply to your use of the Services. Functionality varies by region. Learn more.
This repository is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this repository.
This repository is offered via an open source license. It is not governed by the Google Maps Platform Support Technical Support Services Guidelines, the SLA, or the Deprecation Policy (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).
If you find a bug, or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our developer community channels. If you'd like to contribute, please check the Contributing guide.
You can also discuss this library on our Discord server.