Skip to content

creative-dev-lab/CFCAppDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CFCAppDemo (Or Carbon Footprint Calculator app demo)

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.

🔧 Environment

<iOS>-<iOS 16.2 and later>
<Xcode>-<Xcode 14.2>
<Swift>-<Swift 5>

📲 Prerequisites

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.

Step 1

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.

image image

Step 2

Add your api key to the added API_KEY.plist file.

image

🎉🎉🎉 You are now all set.

✈️ 🏨 Key Components and Design Decisions

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 NavigationView and NavigationStack
  • 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 .plist file
  • ...

🍔 🥩 Sample GIF and Images

Light Dark
light dark

Flight Search

Light Dark
Simulator Screen Shot - iPhone 14 Pro - 2023-02-21 at 04 23 19 Simulator Screen Shot - iPhone 14 Pro - 2023-02-21 at 04 24 06

Flight Offset

Light Dark
Simulator Screen Shot - iPhone 14 Pro - 2023-02-21 at 04 23 25 Simulator Screen Shot - iPhone 14 Pro - 2023-02-21 at 04 22 50

🏗️ Building

Building and running the project is as simple as cloning the repository, opening CFCAppDemo.xcodeproj and building the CFCAppDemo target.

About

Carbon Footprint Calculator app demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages