-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* extract previews * show template view while loading trains (without cached trains) * introduce mockMode * extract AppMode and AppState * add label cachedTrains: * add isLoading computed property to AppState; use AppModel instead of passing in isLoading parameter * use inactive toolbar and timetable style also for error views * no more StationTimesViewLoadingFirstTime.swift * bundle update; update to Xcode 15.4 in fastfile * bump version number * Build Version Bump by fastlane for TestFlight release * small fixes * rename LuasWatch_Watch_App * bring back animations * rename OverflowView OverflowDotsView
- Loading branch information
Showing
31 changed files
with
490 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Created by Roland Gropmair on 27/05/2024. | ||
// Copyright © 2024 mApps.ie. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// The way the user decided how current station should be determined | ||
public enum AppMode: Equatable { | ||
|
||
/// need location | ||
case closest | ||
case closestOtherLine | ||
|
||
/// no location required, because user selected specific station (via various options) | ||
case favourite(TrainStation) | ||
case nearby(TrainStation) | ||
case specific(TrainStation) | ||
case recents(TrainStation) | ||
|
||
public var specificStation: TrainStation? { | ||
switch self { | ||
|
||
case .closest, .closestOtherLine: | ||
return nil | ||
case .favourite(let station), .nearby(let station), .specific(let station), .recents(let station): | ||
return station | ||
} | ||
} | ||
|
||
public var needsLocation: Bool { | ||
self == .closest || self == .closestOtherLine | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Created by Roland Gropmair on 27/05/2024. | ||
// Copyright © 2024 mApps.ie. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// App's state machine, drives UI | ||
public enum AppState { | ||
|
||
case idle | ||
|
||
case gettingLocation | ||
case locationAuthorizationUnknown | ||
case errorGettingLocation(String) | ||
|
||
/// in case the user is too far away from Dublin area | ||
case errorGettingStation(String) | ||
|
||
// cachedTrains is optional because when we load that station for the first time, we won't have any trains cached | ||
case loadingDueTimes(TrainStation, cachedTrains: TrainsByDirection?) | ||
|
||
case errorGettingDueTimes(TrainStation, String) | ||
|
||
case foundDueTimes(TrainsByDirection) | ||
|
||
public init(_ state: AppState) { | ||
self = state | ||
} | ||
} | ||
|
||
public extension AppState { | ||
|
||
var isLoading: Bool { | ||
if case .loadingDueTimes = self { | ||
return true | ||
} else { | ||
return false | ||
} | ||
} | ||
} |
Oops, something went wrong.