Skip to content

Commit 744caae

Browse files
committed
chore(app): prev iOS & watchOS support
1 parent b0b3c1e commit 744caae

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

apps/mobile/metro-now/metro-now Watch App/pages/platform/platform-detail.view.swift

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ struct PlatformDetailView: View {
2626
let backgroundColor = getColorByRouteName(
2727
metroLine ?? MetroLine(rawValue: departures[0].route)
2828
)
29+
let hasNextDeparture = departures.count > 1
2930

3031
PlatformDetailNextDepartureView(
3132
headsign: departures[0].headsign,
3233
departure: departures[0].departure.scheduled,
33-
nextHeadsign: departures[1].headsign,
34-
nextDeparture: departures[1].departure.predicted
34+
nextHeadsign: hasNextDeparture ? departures[1].headsign : nil,
35+
nextDeparture: hasNextDeparture ? departures[1].departure.predicted : nil
3536
)
3637
.containerBackground(backgroundColor.gradient, for: .tabView)
3738

@@ -48,14 +49,20 @@ struct PlatformDetailView: View {
4849
ToolbarItem(
4950
placement: .confirmationAction)
5051
{
51-
Text(metroLineName)
52-
.overlay(
53-
Circle()
54-
.size(width: 32, height: 32, anchor: .center)
55-
.stroke(.white.opacity(0.6), lineWidth: 3)
56-
)
57-
.fontWeight(.semibold)
58-
.foregroundStyle(.white.opacity(0.6))
52+
if #available(watchOS 11, *) {
53+
Text(metroLineName)
54+
.overlay(
55+
Circle()
56+
.size(width: 28, height: 28, anchor: .center)
57+
.stroke(.white.opacity(0.6), lineWidth: 3)
58+
)
59+
.fontWeight(.semibold)
60+
.foregroundStyle(.white.opacity(0.6))
61+
} else {
62+
Text(metroLineName)
63+
.fontWeight(.semibold)
64+
.foregroundStyle(.white)
65+
}
5966
}
6067
}
6168
}

apps/mobile/metro-now/metro-now.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
SWIFT_EMIT_LOC_STRINGS = YES;
391391
SWIFT_VERSION = 5.0;
392392
TARGETED_DEVICE_FAMILY = 4;
393-
WATCHOS_DEPLOYMENT_TARGET = 11;
393+
WATCHOS_DEPLOYMENT_TARGET = 10;
394394
};
395395
name = Debug;
396396
};
@@ -423,7 +423,7 @@
423423
SWIFT_VERSION = 5.0;
424424
TARGETED_DEVICE_FAMILY = 4;
425425
VALIDATE_PRODUCT = YES;
426-
WATCHOS_DEPLOYMENT_TARGET = 11;
426+
WATCHOS_DEPLOYMENT_TARGET = 10;
427427
};
428428
name = Release;
429429
};
@@ -446,7 +446,7 @@
446446
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
447447
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
448448
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
449-
IPHONEOS_DEPLOYMENT_TARGET = 18;
449+
IPHONEOS_DEPLOYMENT_TARGET = 17;
450450
LD_RUNPATH_SEARCH_PATHS = (
451451
"$(inherited)",
452452
"@executable_path/Frameworks",
@@ -480,7 +480,7 @@
480480
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
481481
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
482482
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
483-
IPHONEOS_DEPLOYMENT_TARGET = 18;
483+
IPHONEOS_DEPLOYMENT_TARGET = 17;
484484
LD_RUNPATH_SEARCH_PATHS = (
485485
"$(inherited)",
486486
"@executable_path/Frameworks",

0 commit comments

Comments
 (0)