-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Background and Motivation
Proposed API
Original specs
- https://github.com/dotnet/designs/blob/main/accepted/2020/platform-checks/platform-checks.md#attributes
- https://github.com/dotnet/designs/blob/main/accepted/2020/platform-exclusion/platform-exclusion.md
This was removed in 5.0 RC
dotnet/docs#20635 mention
ObsoletedInOSPlatformAttributewas removed, as this annotation is not needed at this time
With the addition of Xamarin SDK I think the need/time has come :-)
Usage Examples
Apple commonly obsoletes API and provide better alternatives for them. The headers (both C and Objective-C) includes macros that help developers (and the Xcode IDE) select the best API for the OS version being targeted.
The existing Xamarin SDKs (iOS/Mac) annotate the API with the similar attributes. This allow developers to identify which API are obsolete, well before they become deprecated (which generally means they will be rejected if submitted to one of the Apple App Stores).
| Current | Dotnet (planned) |
|---|---|
| [Introduced (PlatformName.iOS, 7,0)] | [SupportedOSPlatform ("ios7.0")] |
| [Obsoleted (PlatformName.iOS, 12,1)] | [ObsoletedInOSPlatform ("ios12.1")] |
| [Deprecated (PlatformName.iOS, 14,3)] | [UnsupportedOSPlatform ("ios14.3")] |
| [Unavailable (PlatformName.iOS)] | [UnsupportedOSPlatform ("ios")] |
The removal of ObsoletedInOSPlatform is blocking the completion of dotnet/macios#10170
Alternative Designs
None
Risks
The lack of this attribute means the analyzer can't have feature parity (regression) compared to the existing features available on VS.