Open venkatesh5789 opened 2 days ago
This takes a #available usage in a result builder and adds the availability information to the swiftconstvalues files.
#available
swiftconstvalues
An example usage is the following:
public struct MyFooProviderInferred: FooProvider { public static var foos: [Foo] { if #available(iOS 18.0, macOS 15.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) { Foo(name: "Blah 1") } else { Foo(name: "Other Blah") } } }
This adds the following to the existing swiftconstvalues file:
"availabilityAttributes": [ { "platform": "iOS", "minVersion": "18.0" }, { "platform": "macOS", "minVersion": "15.0" }, { "platform": "watchOS", "minVersion": "11.0" }, { "platform": "tvOS", "minVersion": "18.0" }, { "platform": "visionOS", "minVersion": "2.0" } ],
This takes a
#available
usage in a result builder and adds the availability information to theswiftconstvalues
files.An example usage is the following:
This adds the following to the existing
swiftconstvalues
file: