SKPaymentQueue.defaultQueue().addPayment(payment) Crash when moving between VC Swift
I found the solution, you need to clean the SKPaymentQueue
in the viewWillDisappear
Update Swift 4.x
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
SKPaymentQueue.default().remove(self)
}
Swift 2.3
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated: animated)
SKPaymentQueue.defaultQueue().removeTransactionObserver(self)
}