_ _
| |_ _ __(_)_ __
| __| '__| | '_ \
| |_| | | | |_) |
\__|_| |_| .__/
|_|
_
_ __ | | __ _ _ __ _ __ ___ _ __
| '_ \| |/ _` | '_ \| '_ \ / _ \ '__|
| |_) | | (_| | | | | | | | __/ |
| .__/|_|\__,_|_| |_|_| |_|\___|_|
|_|
There is no extra setup step to be done, just be sure you have the correct Xcode version (Xcode 15+) installed.
The App downloads information from this base url. If you want to use a different base URL, it can be done by updating the API_URL variable defined at Debug.xcconfig file. (Located at: TripPlanner/Configurations/Debug.xcconfig).
Important: Note that we need the
/$()/for escaping the//.
-
The App goal is to find the cheapest route between two cities (
DepartureandDestination) based on its accumulated price. To achieve such a result theDijkstraalgorithm was chosen. -
The App was almost fully built with
SwiftUI, the only exception was theAnnotationsMapViewcomponent, which is aUIViewRepresentablethat wraps anMKMapViewfor building the map UI. This decision was made given the limitation thatSwiftUI.Mapstill has. -
In the current version of the App, I'm injecting the
URLSessioninstance into theFlightConnectionsServicedirectly. Ideally, I would create another component that is the interface of theURLSessionin a more reusable way (HTTPClientgeneric component or similar), but given this app has only one single request to one endpoint, I decided that is fair to have it in this way. Later if a new endpoint comes it'll be time to refactor to a more reusable way. -
Currently, all requests hit the networking, ideally, we would also have a
cachelayer to avoid hitting the networking all the time. -
Given the simple nature of the app, I decided to have multiple
Publishedproperties as a public interface for the view, but one other approach would be to have a singlestateproperty for having a centralized place for performing mutations.
-
Move Strings to a
.stringsfile for handling localization properly. -
Define better styles for all UI components.