This is how I did it...
class iAPManager: NSObject, SKPaymentTransactionObserver {
var isPro: Binding<Bool>
let productID = "xyz"
public init(isPro: Binding<Bool>) {
self.isPro = isPro
}
-- your code here --
}
To change the binding value:
self.isPro.wrappedValue = true
(or)
self.isPro.wrappedValue.toggle()