Question
When a struct includes a deprecated variable, the generated variable correctly gets a @available(*, deprecated) notation. However, the struct also gets an autogenerated init which uses this deprecated variable, and is not itself marked as deprecated, thus generating a workspace-wide warning message.
I was initially hoping you could just autogenerate a pragma silence to the specific line in the init that uses the deprecated value, but I now realize it's not possible to do so in Swift.
However - if the entire init is marked as deprecated, it would silence the use within.
I don't know, maybe this just moves the problem elsewhere, or maybe it's better with one deprecated init (including all deprecated variables) and one non-deprecated init that just omits the deprecated variabels and just don't set them (as long as they are optional, I think they should implicitly resolve to nil without warnings?)
I'm not sure what's best, I'm just sad about the warnings we're getting.
Question
When a struct includes a deprecated variable, the generated variable correctly gets a
@available(*, deprecated)notation. However, the struct also gets an autogenerated init which uses this deprecated variable, and is not itself marked as deprecated, thus generating a workspace-wide warning message.I was initially hoping you could just autogenerate a pragma silence to the specific line in the init that uses the deprecated value, but I now realize it's not possible to do so in Swift.
However - if the entire init is marked as deprecated, it would silence the use within.
I don't know, maybe this just moves the problem elsewhere, or maybe it's better with one deprecated init (including all deprecated variables) and one non-deprecated init that just omits the deprecated variabels and just don't set them (as long as they are optional, I think they should implicitly resolve to nil without warnings?)
I'm not sure what's best, I'm just sad about the warnings we're getting.