Skip to content

Instantly share code, notes, and snippets.

@y8k
Created October 26, 2015 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y8k/c96c6811b9d72c0b31a3 to your computer and use it in GitHub Desktop.
Save y8k/c96c6811b9d72c0b31a3 to your computer and use it in GitHub Desktop.
Dynamic quick actions example
let firstShortCutIcon = UIApplicationShortcutIcon(templateImageName: "ShortCut01")
let firstFunctionShortCutItem = UIApplicationShortcutItem(type: "com.y8k.touchExample.function01", localizedTitle: "Member Func. 1", localizedSubtitle: "Dynamic short cut item", icon: firstShortCutIcon, userInfo: nil)
let secondShortCutIcon = UIApplicationShortcutIcon(templateImageName: "ShortCut02")
let secondFunctionShortCutItem = UIApplicationShortcutItem(type: "com.y8k.touchExample.function02", localizedTitle: "Member Func. 2", localizedSubtitle: "Dynamic short cut item", icon: secondShortCutIcon, userInfo: nil)
UIApplication.sharedApplication().shortcutItems = [firstFunctionShortCutItem, secondFunctionShortCutItem]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment