Skip to content

Instantly share code, notes, and snippets.

@ppeszko
Last active August 12, 2016 11:06
Show Gist options
  • Select an option

  • Save ppeszko/7aa4733273458808be4a5d0db59c92b1 to your computer and use it in GitHub Desktop.

Select an option

Save ppeszko/7aa4733273458808be4a5d0db59c92b1 to your computer and use it in GitHub Desktop.
// It's just an example for notifications. The rest can be safely ignored :)
class HappyPaymentViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
PaymentNotifications.accepted.observe(self,
selector: #selector(HappyPaymentViewController.paymentNotificationReceived(_:)))
PaymentNotifications.rejected.observe(self,
selector: #selector(HappyPaymentViewController.paymentNotificationReceived(_:)))
}
func paymentServiceDidReturn(paymentResponse: PaymentResponse) {
switch paymentResponse {
case .Accepted(_):
PaymentNotifications.accepted.post()
case .Rejected(_):
PaymentNotifications.rejected.post()
}
}
func paymentNotificationReceived(notification: NSNotification) {
//FIXIT: Write this code before release, okay? Bye, I'm off for vacation. ᕕ( ᐛ )ᕗ
}
deinit {
NSNotificationCenter.defaultCenter().removeObserver(self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment