Skip to content

Commit c2b0625

Browse files
davdromanJonge
andauthored
Fix 2026 availability checks (#463)
Co-authored-by: David Jongepier <[email protected]>
1 parent 7835bc9 commit c2b0625

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Sources/PlatformVersion.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ extension iOSVersion {
128128
if #available(iOS 27, *) {
129129
return .past
130130
}
131-
if #available(iOS 26, *) {
131+
// Apps built before the iOS 26 SDK get "19.0" as the system version from ProcessInfo.
132+
// Once built with the iOS 26 SDK, the version then becomes "26.0".
133+
if #available(iOS 19, *) {
132134
return .current
133135
}
134136
return .future
@@ -238,7 +240,9 @@ extension tvOSVersion {
238240
if #available(tvOS 27, *) {
239241
return .past
240242
}
241-
if #available(tvOS 26, *) {
243+
// Apps built before the tvOS 26 SDK get "19.0" as the system version from ProcessInfo.
244+
// Once built with the tvOS 26 SDK, the version then becomes "26.0".
245+
if #available(tvOS 19, *) {
242246
return .current
243247
}
244248
return .future
@@ -362,7 +366,9 @@ extension macOSVersion {
362366
if #available(macOS 27, *) {
363367
return .past
364368
}
365-
if #available(macOS 26, *) {
369+
// Apps built before the macOS 26 SDK get "16.0" as the system version from ProcessInfo.
370+
// Once built with the macOS 26 SDK, the version then becomes "26.0".
371+
if #available(macOS 16, *) {
366372
return .current
367373
}
368374
return .future
@@ -416,7 +422,9 @@ extension visionOSVersion {
416422
if #available(visionOS 27, *) {
417423
return .past
418424
}
419-
if #available(visionOS 26, *) {
425+
// Apps built before the visionOS 26 SDK get "3.0" as the system version from ProcessInfo.
426+
// Once built with the visionOS 26 SDK, the version then becomes "26.0".
427+
if #available(visionOS 3, *) {
420428
return .current
421429
}
422430
return .future

0 commit comments

Comments
 (0)