弃用 Swift 中的枚举值

ubu*_*oid 2 enums annotations swift

是否可以将 Swift 中的枚举值标记为已弃用?

我试过

enum RelativeDays {
   case today, tomorrow, @available(*, deprecated, message: "Don't live in the past! Cherish the moment and look forward to the future!") yesterday
}
Run Code Online (Sandbox Code Playgroud)

但我收到一个编译错误,指出注释所在的位置需要一个标识符。

Kir*_* S. 12

我认为这只是语法:

enum RelativeDays {
   case today
   @available(*, deprecated, message: "Don't live in the past! Cherish the moment and look forward to the future!")
   case tomorrow
}
Run Code Online (Sandbox Code Playgroud)

作品: 在此输入图像描述