TIL about this "CustomAvailability" experimental feature in Swift. Looks like Apple is using it for feature flags 👀

Swift gives developers a way to limit the use of declarations in certain contexts using the @available attribute. For example, a library developer can specify that a new API is only available at runtime on macOS 15 or newer using @available: @available(macOS, introduced: 15) public struct Foo { /* ... */ } The compiler only accepts references to the struct Foo in code that proves that it executes on macOS 15 or later, using either @available or if #available(...): let _ = Foo() // error: 'Foo...