This is a demo mobile application written in SwiftUI in which the user can select an origin and a destination airport, and calculate the carbon footprint of taking a flight between the selected airport.
In this demo, we took the approach to secure the secrets in the easiest, yet quite effective Apple’s way, using .plist file.
You are going to need your toohla api-key, which is used to get the flight offset data from their web services.
Once you get the API Key from toohla, please follow the below steps to secure the api key.
Add a plist file at the root level of this project, and name it as you want.
In this demo, it is supposed to be API_KEY.
Add your api key to the added API_KEY.plist file.
🎉🎉🎉 You are now all set.
It consists of 3 pages total, i.e. Main page, the flight search screen for From-Location and the To-Destination, and the flight offset show-off page.
- Basic UI/UX Design Using SwiftUI Components
- Demonstration of the simple navigation using
NavigationViewandNavigationStack - Demonstration of the custom search text field and the list
- Demonstration of How to throttle search (based on typing speed)
- Demonstration of using color sets for the light/dark appearance
- Demonstration of using ViewModel - (expandable to MVVM design pattern)
- Demonstration of custom API client using
URLRequest - Demonstration of securing API Key by using
.plistfile - ...
| Light | Dark |
|---|---|
![]() |
![]() |
| Light | Dark |
|---|---|
![]() |
![]() |
| Light | Dark |
|---|---|
![]() |
![]() |
Building and running the project is as simple as cloning the repository, opening CFCAppDemo.xcodeproj and building the CFCAppDemo target.








