Created
August 16, 2016 12:55
-
-
Save janodev/a5721c1787b261c4e4d4d95e906480f5 to your computer and use it in GitHub Desktop.
Handle the action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotificationViewController: UIViewController, UINotificationContentExtension | |
{ | |
func didReceive(_ response: UNNotificationResponse, | |
completionHandler done: (UNNotificationContentExtensionResponseOption) -> Void) | |
{ | |
server.postEventResponse(response.actionIdentifier) | |
{ | |
if response.actionIdentifier == "accept" | |
{ | |
eventResponse.text = "Going!" | |
eventResponse.textColor = UIColor.green() | |
} | |
else if response.actionIdentifier == "decline" | |
{ | |
eventResponse.text = "Not going :(" | |
eventResponse.textColor = UIColor.red() | |
} | |
done(.dismiss) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am trying to implement something like this in my app, I have a question regarding the line no.6, Where did you get/create the object server.