├── .gitignore ├── AppShortCut.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Frederik.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Frederik.xcuserdatad │ └── xcschemes │ ├── AppShortCut.xcscheme │ └── xcschememanagement.plist ├── AppShortCut ├── AddUserViewController.swift ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-76.png │ │ └── Icon-76@2x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | 28 | # Carthage 29 | # 30 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 31 | # Carthage/Checkouts 32 | 33 | Carthage/Build 34 | .DS_Store 35 | -------------------------------------------------------------------------------- /AppShortCut.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 86B0B9171BC1255E0024C4CB /* AddUserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B0B9161BC1255E0024C4CB /* AddUserViewController.swift */; settings = {ASSET_TAGS = (); }; }; 11 | 86FAE7E41BBC007100776915 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86FAE7E31BBC007100776915 /* AppDelegate.swift */; }; 12 | 86FAE7E61BBC007100776915 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86FAE7E51BBC007100776915 /* ViewController.swift */; }; 13 | 86FAE7E91BBC007100776915 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 86FAE7E71BBC007100776915 /* Main.storyboard */; }; 14 | 86FAE7EB1BBC007100776915 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 86FAE7EA1BBC007100776915 /* Assets.xcassets */; }; 15 | 86FAE7EE1BBC007100776915 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 86FAE7EC1BBC007100776915 /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 86B0B9161BC1255E0024C4CB /* AddUserViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddUserViewController.swift; sourceTree = ""; }; 20 | 86FAE7E01BBC007100776915 /* AppShortCut.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppShortCut.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 86FAE7E31BBC007100776915 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | 86FAE7E51BBC007100776915 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 23 | 86FAE7E81BBC007100776915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | 86FAE7EA1BBC007100776915 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 86FAE7ED1BBC007100776915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | 86FAE7EF1BBC007100776915 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 86FAE7DD1BBC007100776915 /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 86FAE7D71BBC007100776915 = { 41 | isa = PBXGroup; 42 | children = ( 43 | 86FAE7E21BBC007100776915 /* AppShortCut */, 44 | 86FAE7E11BBC007100776915 /* Products */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 86FAE7E11BBC007100776915 /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 86FAE7E01BBC007100776915 /* AppShortCut.app */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 86FAE7E21BBC007100776915 /* AppShortCut */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 86FAE7E31BBC007100776915 /* AppDelegate.swift */, 60 | 86B0B9161BC1255E0024C4CB /* AddUserViewController.swift */, 61 | 86FAE7E51BBC007100776915 /* ViewController.swift */, 62 | 86FAE7E71BBC007100776915 /* Main.storyboard */, 63 | 86FAE7EA1BBC007100776915 /* Assets.xcassets */, 64 | 86FAE7EC1BBC007100776915 /* LaunchScreen.storyboard */, 65 | 86FAE7EF1BBC007100776915 /* Info.plist */, 66 | ); 67 | path = AppShortCut; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 86FAE7DF1BBC007100776915 /* AppShortCut */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 86FAE7F21BBC007100776915 /* Build configuration list for PBXNativeTarget "AppShortCut" */; 76 | buildPhases = ( 77 | 86FAE7DC1BBC007100776915 /* Sources */, 78 | 86FAE7DD1BBC007100776915 /* Frameworks */, 79 | 86FAE7DE1BBC007100776915 /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = AppShortCut; 86 | productName = AppShortCut; 87 | productReference = 86FAE7E01BBC007100776915 /* AppShortCut.app */; 88 | productType = "com.apple.product-type.application"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 86FAE7D81BBC007100776915 /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | LastUpgradeCheck = 0700; 97 | ORGANIZATIONNAME = "Frederik Jacques"; 98 | TargetAttributes = { 99 | 86FAE7DF1BBC007100776915 = { 100 | CreatedOnToolsVersion = 7.0.1; 101 | DevelopmentTeam = FEHW9JL2T8; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = 86FAE7DB1BBC007100776915 /* Build configuration list for PBXProject "AppShortCut" */; 106 | compatibilityVersion = "Xcode 3.2"; 107 | developmentRegion = English; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | Base, 112 | ); 113 | mainGroup = 86FAE7D71BBC007100776915; 114 | productRefGroup = 86FAE7E11BBC007100776915 /* Products */; 115 | projectDirPath = ""; 116 | projectRoot = ""; 117 | targets = ( 118 | 86FAE7DF1BBC007100776915 /* AppShortCut */, 119 | ); 120 | }; 121 | /* End PBXProject section */ 122 | 123 | /* Begin PBXResourcesBuildPhase section */ 124 | 86FAE7DE1BBC007100776915 /* Resources */ = { 125 | isa = PBXResourcesBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | 86FAE7EE1BBC007100776915 /* LaunchScreen.storyboard in Resources */, 129 | 86FAE7EB1BBC007100776915 /* Assets.xcassets in Resources */, 130 | 86FAE7E91BBC007100776915 /* Main.storyboard in Resources */, 131 | ); 132 | runOnlyForDeploymentPostprocessing = 0; 133 | }; 134 | /* End PBXResourcesBuildPhase section */ 135 | 136 | /* Begin PBXSourcesBuildPhase section */ 137 | 86FAE7DC1BBC007100776915 /* Sources */ = { 138 | isa = PBXSourcesBuildPhase; 139 | buildActionMask = 2147483647; 140 | files = ( 141 | 86FAE7E61BBC007100776915 /* ViewController.swift in Sources */, 142 | 86B0B9171BC1255E0024C4CB /* AddUserViewController.swift in Sources */, 143 | 86FAE7E41BBC007100776915 /* AppDelegate.swift in Sources */, 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | }; 147 | /* End PBXSourcesBuildPhase section */ 148 | 149 | /* Begin PBXVariantGroup section */ 150 | 86FAE7E71BBC007100776915 /* Main.storyboard */ = { 151 | isa = PBXVariantGroup; 152 | children = ( 153 | 86FAE7E81BBC007100776915 /* Base */, 154 | ); 155 | name = Main.storyboard; 156 | sourceTree = ""; 157 | }; 158 | 86FAE7EC1BBC007100776915 /* LaunchScreen.storyboard */ = { 159 | isa = PBXVariantGroup; 160 | children = ( 161 | 86FAE7ED1BBC007100776915 /* Base */, 162 | ); 163 | name = LaunchScreen.storyboard; 164 | sourceTree = ""; 165 | }; 166 | /* End PBXVariantGroup section */ 167 | 168 | /* Begin XCBuildConfiguration section */ 169 | 86FAE7F01BBC007100776915 /* Debug */ = { 170 | isa = XCBuildConfiguration; 171 | buildSettings = { 172 | ALWAYS_SEARCH_USER_PATHS = NO; 173 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 174 | CLANG_CXX_LIBRARY = "libc++"; 175 | CLANG_ENABLE_MODULES = YES; 176 | CLANG_ENABLE_OBJC_ARC = YES; 177 | CLANG_WARN_BOOL_CONVERSION = YES; 178 | CLANG_WARN_CONSTANT_CONVERSION = YES; 179 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 180 | CLANG_WARN_EMPTY_BODY = YES; 181 | CLANG_WARN_ENUM_CONVERSION = YES; 182 | CLANG_WARN_INT_CONVERSION = YES; 183 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 184 | CLANG_WARN_UNREACHABLE_CODE = YES; 185 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 186 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 187 | COPY_PHASE_STRIP = NO; 188 | DEBUG_INFORMATION_FORMAT = dwarf; 189 | ENABLE_STRICT_OBJC_MSGSEND = YES; 190 | ENABLE_TESTABILITY = YES; 191 | GCC_C_LANGUAGE_STANDARD = gnu99; 192 | GCC_DYNAMIC_NO_PIC = NO; 193 | GCC_NO_COMMON_BLOCKS = YES; 194 | GCC_OPTIMIZATION_LEVEL = 0; 195 | GCC_PREPROCESSOR_DEFINITIONS = ( 196 | "DEBUG=1", 197 | "$(inherited)", 198 | ); 199 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 200 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 201 | GCC_WARN_UNDECLARED_SELECTOR = YES; 202 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 203 | GCC_WARN_UNUSED_FUNCTION = YES; 204 | GCC_WARN_UNUSED_VARIABLE = YES; 205 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 206 | MTL_ENABLE_DEBUG_INFO = YES; 207 | ONLY_ACTIVE_ARCH = YES; 208 | SDKROOT = iphoneos; 209 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 210 | TARGETED_DEVICE_FAMILY = "1,2"; 211 | }; 212 | name = Debug; 213 | }; 214 | 86FAE7F11BBC007100776915 /* Release */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | ALWAYS_SEARCH_USER_PATHS = NO; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_WARN_BOOL_CONVERSION = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_EMPTY_BODY = YES; 226 | CLANG_WARN_ENUM_CONVERSION = YES; 227 | CLANG_WARN_INT_CONVERSION = YES; 228 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 229 | CLANG_WARN_UNREACHABLE_CODE = YES; 230 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 231 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 232 | COPY_PHASE_STRIP = NO; 233 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 234 | ENABLE_NS_ASSERTIONS = NO; 235 | ENABLE_STRICT_OBJC_MSGSEND = YES; 236 | GCC_C_LANGUAGE_STANDARD = gnu99; 237 | GCC_NO_COMMON_BLOCKS = YES; 238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 240 | GCC_WARN_UNDECLARED_SELECTOR = YES; 241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 242 | GCC_WARN_UNUSED_FUNCTION = YES; 243 | GCC_WARN_UNUSED_VARIABLE = YES; 244 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 245 | MTL_ENABLE_DEBUG_INFO = NO; 246 | SDKROOT = iphoneos; 247 | TARGETED_DEVICE_FAMILY = "1,2"; 248 | VALIDATE_PRODUCT = YES; 249 | }; 250 | name = Release; 251 | }; 252 | 86FAE7F31BBC007100776915 /* Debug */ = { 253 | isa = XCBuildConfiguration; 254 | buildSettings = { 255 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 256 | CODE_SIGN_IDENTITY = "iPhone Developer"; 257 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 258 | INFOPLIST_FILE = AppShortCut/Info.plist; 259 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 260 | PRODUCT_BUNDLE_IDENTIFIER = be.thenerd.sandbox.AppShortCut; 261 | PRODUCT_NAME = "$(TARGET_NAME)"; 262 | PROVISIONING_PROFILE = ""; 263 | }; 264 | name = Debug; 265 | }; 266 | 86FAE7F41BBC007100776915 /* Release */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 270 | CODE_SIGN_IDENTITY = "iPhone Developer"; 271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 272 | INFOPLIST_FILE = AppShortCut/Info.plist; 273 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 274 | PRODUCT_BUNDLE_IDENTIFIER = be.thenerd.sandbox.AppShortCut; 275 | PRODUCT_NAME = "$(TARGET_NAME)"; 276 | PROVISIONING_PROFILE = ""; 277 | }; 278 | name = Release; 279 | }; 280 | /* End XCBuildConfiguration section */ 281 | 282 | /* Begin XCConfigurationList section */ 283 | 86FAE7DB1BBC007100776915 /* Build configuration list for PBXProject "AppShortCut" */ = { 284 | isa = XCConfigurationList; 285 | buildConfigurations = ( 286 | 86FAE7F01BBC007100776915 /* Debug */, 287 | 86FAE7F11BBC007100776915 /* Release */, 288 | ); 289 | defaultConfigurationIsVisible = 0; 290 | defaultConfigurationName = Release; 291 | }; 292 | 86FAE7F21BBC007100776915 /* Build configuration list for PBXNativeTarget "AppShortCut" */ = { 293 | isa = XCConfigurationList; 294 | buildConfigurations = ( 295 | 86FAE7F31BBC007100776915 /* Debug */, 296 | 86FAE7F41BBC007100776915 /* Release */, 297 | ); 298 | defaultConfigurationIsVisible = 0; 299 | defaultConfigurationName = Release; 300 | }; 301 | /* End XCConfigurationList section */ 302 | }; 303 | rootObject = 86FAE7D81BBC007100776915 /* Project object */; 304 | } 305 | -------------------------------------------------------------------------------- /AppShortCut.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AppShortCut.xcodeproj/project.xcworkspace/xcuserdata/Frederik.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frederik-jacques/quick-actions-3d-touch-tutorial/1f8784ec51794af31446b9cf1dcbeea9b823975a/AppShortCut.xcodeproj/project.xcworkspace/xcuserdata/Frederik.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AppShortCut.xcodeproj/xcuserdata/Frederik.xcuserdatad/xcschemes/AppShortCut.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /AppShortCut.xcodeproj/xcuserdata/Frederik.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AppShortCut.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 86FAE7DF1BBC007100776915 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AppShortCut/AddUserViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AddUserViewController.swift 3 | // AppShortCut 4 | // 5 | // Created by Frederik Jacques on 04/10/15. 6 | // Copyright © 2015 Frederik Jacques. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AddUserViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | // Do any additional setup after loading the view. 17 | } 18 | 19 | override func didReceiveMemoryWarning() { 20 | super.didReceiveMemoryWarning() 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | 25 | /* 26 | // MARK: - Navigation 27 | 28 | // In a storyboard-based application, you will often want to do a little preparation before navigation 29 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 30 | // Get the new view controller using segue.destinationViewController. 31 | // Pass the selected object to the new view controller. 32 | } 33 | */ 34 | 35 | } 36 | -------------------------------------------------------------------------------- /AppShortCut/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AppShortCut 4 | // 5 | // Created by Frederik Jacques on 30/09/15. 6 | // Copyright © 2015 Frederik Jacques. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | var shortcutItem: UIApplicationShortcutItem? 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | print("Application did finish launching with options") 19 | 20 | var performShortcutDelegate = true 21 | 22 | if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem { 23 | 24 | print("Application launched via shortcut") 25 | self.shortcutItem = shortcutItem 26 | 27 | performShortcutDelegate = false 28 | } 29 | 30 | return performShortcutDelegate 31 | 32 | } 33 | 34 | func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) { 35 | 36 | print("Application performActionForShortcutItem") 37 | completionHandler( handleShortcut(shortcutItem) ) 38 | 39 | } 40 | 41 | func handleShortcut( shortcutItem:UIApplicationShortcutItem ) -> Bool { 42 | print("Handling shortcut") 43 | 44 | var succeeded = false 45 | 46 | if( shortcutItem.type == "be.thenerd.appshortcut.new-user" ) { 47 | 48 | // Add your code here 49 | print("- Handling \(shortcutItem.type)") 50 | 51 | // Get the view controller you want to load 52 | let mainSB = UIStoryboard(name: "Main", bundle: nil) 53 | let addUserVC = mainSB.instantiateViewControllerWithIdentifier("AddUserViewController") as! AddUserViewController 54 | 55 | let navVC = self.window?.rootViewController as! UINavigationController 56 | navVC.pushViewController(addUserVC, animated: true) 57 | 58 | succeeded = true 59 | 60 | } 61 | 62 | return succeeded 63 | 64 | } 65 | 66 | func applicationDidBecomeActive(application: UIApplication) { 67 | print("Application did become active") 68 | 69 | guard let shortcut = shortcutItem else { return } 70 | 71 | print("- Shortcut property has been set") 72 | 73 | handleShortcut(shortcut) 74 | 75 | self.shortcutItem = nil 76 | 77 | } 78 | 79 | } 80 | 81 | -------------------------------------------------------------------------------- /AppShortCut/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "Icon-60@2x.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "idiom" : "iphone", 31 | "size" : "60x60", 32 | "scale" : "3x" 33 | }, 34 | { 35 | "idiom" : "ipad", 36 | "size" : "29x29", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "idiom" : "ipad", 41 | "size" : "29x29", 42 | "scale" : "2x" 43 | }, 44 | { 45 | "idiom" : "ipad", 46 | "size" : "40x40", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "size" : "40x40", 52 | "scale" : "2x" 53 | }, 54 | { 55 | "size" : "76x76", 56 | "idiom" : "ipad", 57 | "filename" : "Icon-76.png", 58 | "scale" : "1x" 59 | }, 60 | { 61 | "size" : "76x76", 62 | "idiom" : "ipad", 63 | "filename" : "Icon-76@2x.png", 64 | "scale" : "2x" 65 | } 66 | ], 67 | "info" : { 68 | "version" : 1, 69 | "author" : "xcode" 70 | } 71 | } -------------------------------------------------------------------------------- /AppShortCut/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frederik-jacques/quick-actions-3d-touch-tutorial/1f8784ec51794af31446b9cf1dcbeea9b823975a/AppShortCut/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /AppShortCut/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frederik-jacques/quick-actions-3d-touch-tutorial/1f8784ec51794af31446b9cf1dcbeea9b823975a/AppShortCut/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /AppShortCut/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frederik-jacques/quick-actions-3d-touch-tutorial/1f8784ec51794af31446b9cf1dcbeea9b823975a/AppShortCut/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /AppShortCut/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AppShortCut/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /AppShortCut/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIApplicationShortcutItems 26 | 27 | 28 | UIApplicationShortcutItemIconType 29 | UIApplicationShortcutIconTypeAdd 30 | UIApplicationShortcutItemTitle 31 | Create new user 32 | UIApplicationShortcutItemType 33 | be.thenerd.appshortcut.new-user 34 | UIApplicationShortcutItemUserInfo 35 | 36 | name 37 | Frederik 38 | 39 | 40 | 41 | UILaunchStoryboardName 42 | LaunchScreen 43 | UIMainStoryboardFile 44 | Main 45 | UIRequiredDeviceCapabilities 46 | 47 | armv7 48 | 49 | UISupportedInterfaceOrientations 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | UISupportedInterfaceOrientations~ipad 56 | 57 | UIInterfaceOrientationPortrait 58 | UIInterfaceOrientationPortraitUpsideDown 59 | UIInterfaceOrientationLandscapeLeft 60 | UIInterfaceOrientationLandscapeRight 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /AppShortCut/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AppShortCut 4 | // 5 | // Created by Frederik Jacques on 30/09/15. 6 | // Copyright © 2015 Frederik Jacques. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Frederik Jacques 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | --------------------------------------------------------------------------------