Created
April 1, 2016 17:56
-
-
Save kwylez/054de538b925beea7864ec170529357d to your computer and use it in GitHub Desktop.
This file contains 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
private func execute(launchKey: String, hookType: NotificationHookType, info: Dictionary<String, AnyObject>) -> Void { | |
guard let notificationConfiguration = self.configuration, | |
let notificationHooks = notificationConfiguration.notificationHooks, | |
let ignoreTypes = notificationConfiguration.notificationTypesToIgnore else { return } | |
let hook = notificationHooks.filter({ k, v in k == launchKey && !ignoreTypes.contains(k)}) | |
if !hook.isEmpty { | |
guard let hookBlock = hook.first else { return } | |
let key: String = hookBlock.0 | |
let executionBlock: NotificationHookBlock = notificationHooks[key]! as NotificationHookBlock | |
executionBlock(userInfo: info, hookType: hookType) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment