Last active
August 22, 2025 05:57
-
-
Save abhi21git/ccf9fc56fe5a5eea109c0c1201009a2b to your computer and use it in GitHub Desktop.
Check for iOS 26 (can be modified for other versions too)
This file contains hidden or 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
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