Brother, I just find a solution for my project, It may comes to you workaround, but I still would like to share my experience about it;
class MyClass {
@available(iOS 15.0, *) // Stored properties cannot be marked potentially unavailable with '@available'
var myProperty: String
}
Xcode offers us entire class to make @available
@available(iOS 15.0, *)
class MyClass {
var myProperty: String
}
This is my workaround solution. You can use the @available attribute on its getter and setter methods instead of the property itself.
class MyClass {
private var myValue: String = ""
@available(iOS 15.0, *)
var myProperty: String {
get {
return myValue
}
set {
myValue = newValue
}
}
}
This is from my real project;
