-
Notifications
You must be signed in to change notification settings - Fork 241
Airport Departure Project Finish #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
swift-student
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very solid work, Norlan! You showed good understanding of the concepts from the third module. You should have no problems on the sprint challenge this weekend!
| } | ||
|
|
||
|
|
||
| } // END Class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of a comment to mark the end of your class.
| } | ||
|
|
||
|
|
||
| func passengerAlerts() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal, but this function has an extra level of indentation that isn't needed. The further you can keep stuff to the left, the less chance you have of line wrapping.
| for departure in departureBoard.departureFlights { | ||
|
|
||
| var time = "" | ||
| var terminal = "" | ||
|
|
||
| if let departureTime = departure.departureTime { | ||
|
|
||
| time = dateFormat.string(from: departureTime) | ||
| } | ||
|
|
||
| if let terminalNum = departure.terminal { | ||
| terminal = "\(terminalNum)" | ||
| } | ||
| print("\nDestination \(departure.airport.destination) \nAirline: \(departure.airline) Flight: \(departure.flightNumber) Departure Time: \(time) Terminal: \(terminal) Flight Status: \(departure.fightStatus)") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of variables that are providing default values in case you can't unwrap the optionals. Very good approach.
| // Number Formatter stretch! | ||
| let usCurrencyFormatter = NumberFormatter() | ||
| usCurrencyFormatter.numberStyle = .currency | ||
| if let price = usCurrencyFormatter.string(from: NSNumber(floatLiteral: tripOne)) | ||
| { | ||
| print(price) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work figuring out the number formatter!
@swift-student