ios - dismiss a popup view controller -
i implemented apple pay app. when click on apple pay button, standard pay pop view controller appears. in order dismiss it, can press cancel button want able dismiss pop-up view clicking superview.
func alertclose(gesture: uitapgesturerecognizer) { self.dismiss(animated: true, completion: nil) print("it working") } @ibaction func payapple(_ sender: any) { let paymentviewcontroller = pkpaymentauthorizationviewcontroller(paymentrequest: request) paymentviewcontroller.delegate = self self.present(paymentviewcontroller, animated: true, completion: { paymentviewcontroller.view.superview?.isuserinteractionenabled = true paymentviewcontroller.view.superview?.addgesturerecognizer(uitapgesturerecognizer(target: self, action: #selector(self.alertclose(gesture:)))) }) }
but have implemented above not working. i'm not sure doing wrong. when click superview apple pay pop doesn't dismiss.
Comments
Post a Comment