M FerryTimeTable3.xcodeproj/project.pbxproj => FerryTimeTable3.xcodeproj/project.pbxproj +4 -0
@@ 93,6 93,7 @@
CFECB90C267CDAAD00573971 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = CFECB90B267CDAAD00573971 /* Alamofire */; };
CFECB90D267CDB0900573971 /* Json.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFEF2C1324CADCCE00DA70A4 /* Json.swift */; };
CFEF2C1424CADCCE00DA70A4 /* Json.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFEF2C1324CADCCE00DA70A4 /* Json.swift */; };
+ CFF2219B26862DC200E28400 /* LocationWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFF2219A26862DC200E28400 /* LocationWrapper.swift */; };
FD342830DA4812F7F903F66C /* Pods_FerryTimetable3.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F085409AD139E84060EF67C8 /* Pods_FerryTimetable3.framework */; };
/* End PBXBuildFile section */
@@ 261,6 262,7 @@
CFE1044B24CAB69B00AB1B80 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
CFECB903267CDA2B00573971 /* MenuTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MenuTableViewCell.swift; path = "FerryTimetable3/UI Components/MenuTableViewCell.swift"; sourceTree = SOURCE_ROOT; };
CFEF2C1324CADCCE00DA70A4 /* Json.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Json.swift; sourceTree = "<group>"; };
+ CFF2219A26862DC200E28400 /* LocationWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationWrapper.swift; sourceTree = "<group>"; };
E6698103004970AB6AC217F5 /* Pods_FerryTimetable3_FerryTimetable3UITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FerryTimetable3_FerryTimetable3UITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F085409AD139E84060EF67C8 /* Pods_FerryTimetable3.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FerryTimetable3.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ 510,6 512,7 @@
CFDCE1F6262C0A930093C8C5 /* NotificationController.swift */,
CFDCE1F8262C0A930093C8C5 /* NotificationView.swift */,
CFDCE1FA262C0A930093C8C5 /* ComplicationController.swift */,
+ CFF2219A26862DC200E28400 /* LocationWrapper.swift */,
CFDCE1FC262C0A940093C8C5 /* Assets.xcassets */,
CFDCE201262C0A940093C8C5 /* Info.plist */,
CFDCE202262C0A940093C8C5 /* PushNotificationPayload.apns */,
@@ 993,6 996,7 @@
CFDCE1F9262C0A930093C8C5 /* NotificationView.swift in Sources */,
CF16EB4D262E8A44006080FC /* Metadata.swift in Sources */,
CF16EB54262E8A98006080FC /* Schedule.swift in Sources */,
+ CFF2219B26862DC200E28400 /* LocationWrapper.swift in Sources */,
CFD51595262DBAB300F4E972 /* Timetable.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
M WatchApp Extension/ContentView.swift => WatchApp Extension/ContentView.swift +13 -3
@@ 24,6 24,7 @@ struct TimetableView: View {
let f = DateFormatter()
f.timeStyle = .none
f.dateStyle = .short
+ f.timeZone = TimeZone(identifier: "Asia/Hong_Kong")!
return f
}()
let ferries: [[Ferry<Date>]]
@@ 66,6 67,7 @@ struct FerryRow: View {
let f = DateFormatter()
f.timeStyle = .short
f.dateStyle = .none
+ f.timeZone = TimeZone(identifier: "Asia/Hong_Kong")!
return f
}()
let ferry: Ferry<Date>
@@ 123,7 125,13 @@ struct ChooseDirectionView: View {
struct ContentView: View {
@ObservedObject private var modelManager: ModelManager = ModelManager.shared
@ObservedObject private var locationWrapper: LocationWrapper = LocationWrapper()
-
+ let formatter: DateFormatter = {
+ let f = DateFormatter()
+ f.timeStyle = .short
+ f.dateStyle = .none
+ f.timeZone = TimeZone(identifier: "Asia/Hong_Kong")!
+ return f
+ }()
@State var currentDate = Date()
let timer = Timer.publish(every: 30, on: .main, in: .common).autoconnect()
@@ 136,7 144,7 @@ struct ContentView: View {
let showTypeHint = haveSpeedDifference(ferries: toPrimaryFerries + fromPrimaryFerries)
if let l = self.locationWrapper.location,
let direction = modelManager.residenceDirectionWith(location: l) {
- Section(header: Text(directionString(direction, island))) {
+ Section(header: Text(directionString(direction, island) + " (\(formatter.string(from: currentDate)))")) {
NavigationLink(
destination: TimetableView(island: island, direction: direction)
){
@@ 149,12 157,14 @@ struct ContentView: View {
}
}
} else {
- Section {
+ Section(header: Text(directionString(.fromPrimary, island))) {
NavigationLink(
destination: TimetableView(island: island, direction: .fromPrimary)
){
FerryRow(ferry: fromPrimaryFerries[0], showTypeHint: showTypeHint)
}
+ }
+ Section(header: Text(directionString(.toPrimary, island))) {
NavigationLink(
destination: TimetableView(island: island, direction: .toPrimary)
){
A WatchApp/Assets.xcassets/AppIcon.appiconset/24x24@2x.png => WatchApp/Assets.xcassets/AppIcon.appiconset/24x24@2x.png +0 -0
A WatchApp/Assets.xcassets/AppIcon.appiconset/27.5x27.5@2x.png => WatchApp/Assets.xcassets/AppIcon.appiconset/27.5x27.5@2x.png +0 -0
A WatchApp/Assets.xcassets/AppIcon.appiconset/29x29@2x.png => WatchApp/Assets.xcassets/AppIcon.appiconset/29x29@2x.png +0 -0
A WatchApp/Assets.xcassets/AppIcon.appiconset/29x29@3x.png => WatchApp/Assets.xcassets/AppIcon.appiconset/29x29@3x.png +0 -0
A WatchApp/Assets.xcassets/AppIcon.appiconset/40x40@2x-1.png => WatchApp/Assets.xcassets/AppIcon.appiconset/40x40@2x-1.png +0 -0
A WatchApp/Assets.xcassets/AppIcon.appiconset/86x86@2x.png => WatchApp/Assets.xcassets/AppIcon.appiconset/86x86@2x.png +0 -0
M WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json => WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json +17 -0
@@ 1,6 1,17 @@
{
"images" : [
{
+ "idiom" : "ipad",
+ "scale" : "1x",
+ "size" : "40x40"
+ },
+ {
+ "idiom" : "ipad",
+ "scale" : "2x",
+ "size" : "40x40"
+ },
+ {
+ "filename" : "24x24@2x.png",
"idiom" : "watch",
"role" : "notificationCenter",
"scale" : "2x",
@@ 8,6 19,7 @@
"subtype" : "38mm"
},
{
+ "filename" : "27.5x27.5@2x.png",
"idiom" : "watch",
"role" : "notificationCenter",
"scale" : "2x",
@@ 15,18 27,21 @@
"subtype" : "42mm"
},
{
+ "filename" : "29x29@2x.png",
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "2x",
"size" : "29x29"
},
{
+ "filename" : "29x29@3x.png",
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "3x",
"size" : "29x29"
},
{
+ "filename" : "40x40@2x-1.png",
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
@@ 48,6 63,7 @@
"subtype" : "44mm"
},
{
+ "filename" : "86x86@2x.png",
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
@@ 55,6 71,7 @@
"subtype" : "38mm"
},
{
+ "filename" : "ferry-watch-app copy.png",
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
A WatchApp/Assets.xcassets/AppIcon.appiconset/ferry-watch-app copy.png => WatchApp/Assets.xcassets/AppIcon.appiconset/ferry-watch-app copy.png +0 -0