Skip to content

Instantly share code, notes, and snippets.

@abhi21git
Last active August 22, 2025 05:57
Show Gist options
  • Save abhi21git/ccf9fc56fe5a5eea109c0c1201009a2b to your computer and use it in GitHub Desktop.
Save abhi21git/ccf9fc56fe5a5eea109c0c1201009a2b to your computer and use it in GitHub Desktop.
Check for iOS 26 (can be modified for other versions too)
struct AppConfig {
static var isCompilerAtLeast62: Bool {
#if compiler(>=6.2)
return true
#else
return false
#endif
}
// This will only return true when built from Xcode 26 and for iOS 26 on other version it will return false.
static var isOS26Available: Bool {
#if os(iOS)
if #available(iOS 26.0, *) {
return isCompilerAtLeast62
} else {
return false
}
#elseif os(watchOS)
if #available(watchOS 26.0, *) {
return isCompilerAtLeast62
} else {
return false
}
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment