An exercise to use a map(google map) for navigation. It have the features of navigating your for a destination, drawing your travel path, calculating your traveled time and traveled distance. You should have a Google Maps Platform API Key to run this app. Check the official document. Google Maps Platform This app is iOS 15.0 and above supported.
How to Run this App
gem install bundlerif you don’t have bundler in your environment.
bundle installto install cocoapods and cocoapods-keys, which are specified in Gemfile.
bundle exec pod installto install dependencies specified in Podfile.
- The firs time your run bundle pod install, you’ll be asked to provide the Google Maps API key , please provide your own Google Maps API Key.
map-navigation.xcworkspacewith Xcode, if you run it on simultor, you need to simulate location with xcode debugger.
Steps to Build this App
Initialize the project and clone to local.
Browse the Google Map SDK document.
milestoneDownload the sdk, and integrate it into this app, show the simplest map.
- setup google cloud platform, enable billing, enable Google map sdk for ios
- create API key, secure the API key with App Bundle Identifier restriction and quota limit.
- use cocoapods to install the GoogleMaps sdk.
- add API key with cocoapods-keys plugin for obfuscation.
- integrate GoogleMaps view into the app for the simple usage.
- get the API key in AppDelegate
- use UIViewRepresentable to integrate the GMSMapView into SwiftUI
Construct the MVVM pattern.
Make the map started with locating at the user current location.
Add feature that user can tap on the map to select a destination.
milestoneAdd the start button, once it’s clicked, navigate to the destination.
- Add Alamofire for network request
- traveled path in real time
milestoneSummary of the trip
- A map showing the traveled path
- Elapsed trip time
- Total distance traveled
- GPS signal loss notification
- path recalculation