Do I still need the @availible 13.0 attribute in my class if my minimum deployment target is iOS 13.0?

503 views Asked by At

I am adding Combine to my iOS application. To do this, I have updated my create account ViewModel to use Combine rather than my previous implementation. Upon adding Combine to my ViewModel, I was met with an error prompting me to add @available(iOS 13.0, *) to my class. I also must add this attribute to every single VC that uses this ViewModel. My deployment target is iOS 13.0 so I am wondering if this is really necessary. Is there a way I can avoid adding this attribute in each class since I will have no users operating on an iOS version lower than iOS 13.0?

1

There are 1 answers

3
Dávid Pásztor On BEST ANSWER

No. You only need to use @available annotation when your deployment target is lower than the minimum OS version required for the API you are using.

So when targeting iOS 13, you don't need @available for Combine.