diff --git a/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.pbxproj b/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.pbxproj new file mode 100644 index 0000000..55436ef --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.pbxproj @@ -0,0 +1,366 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 8F81BF372629087C009C3F68 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F81BF362629087C009C3F68 /* AppDelegate.swift */; }; + 8F81BF392629087C009C3F68 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F81BF382629087C009C3F68 /* SceneDelegate.swift */; }; + 8F81BF3B2629087C009C3F68 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F81BF3A2629087C009C3F68 /* ViewController.swift */; }; + 8F81BF3E2629087C009C3F68 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F81BF3C2629087C009C3F68 /* Main.storyboard */; }; + 8F81BF402629087D009C3F68 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F81BF3F2629087D009C3F68 /* Assets.xcassets */; }; + 8F81BF432629087D009C3F68 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F81BF412629087D009C3F68 /* LaunchScreen.storyboard */; }; + 8F81BF4E262908F3009C3F68 /* AlertBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F81BF4D262908F3009C3F68 /* AlertBuilder.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8F81BF332629087C009C3F68 /* KeyboardShortcuts.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KeyboardShortcuts.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8F81BF362629087C009C3F68 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 8F81BF382629087C009C3F68 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 8F81BF3A2629087C009C3F68 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 8F81BF3D2629087C009C3F68 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8F81BF3F2629087D009C3F68 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 8F81BF422629087D009C3F68 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 8F81BF442629087D009C3F68 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8F81BF4D262908F3009C3F68 /* AlertBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertBuilder.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8F81BF302629087C009C3F68 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8F81BF2A2629087C009C3F68 = { + isa = PBXGroup; + children = ( + 8F81BF352629087C009C3F68 /* KeyboardShortcuts */, + 8F81BF342629087C009C3F68 /* Products */, + ); + sourceTree = ""; + }; + 8F81BF342629087C009C3F68 /* Products */ = { + isa = PBXGroup; + children = ( + 8F81BF332629087C009C3F68 /* KeyboardShortcuts.app */, + ); + name = Products; + sourceTree = ""; + }; + 8F81BF352629087C009C3F68 /* KeyboardShortcuts */ = { + isa = PBXGroup; + children = ( + 8F81BF4C262908D7009C3F68 /* Support */, + 8F81BF4B262908C3009C3F68 /* View Controllers */, + 8F81BF362629087C009C3F68 /* AppDelegate.swift */, + 8F81BF382629087C009C3F68 /* SceneDelegate.swift */, + 8F81BF3C2629087C009C3F68 /* Main.storyboard */, + 8F81BF3F2629087D009C3F68 /* Assets.xcassets */, + 8F81BF412629087D009C3F68 /* LaunchScreen.storyboard */, + 8F81BF442629087D009C3F68 /* Info.plist */, + ); + path = KeyboardShortcuts; + sourceTree = ""; + }; + 8F81BF4B262908C3009C3F68 /* View Controllers */ = { + isa = PBXGroup; + children = ( + 8F81BF3A2629087C009C3F68 /* ViewController.swift */, + ); + path = "View Controllers"; + sourceTree = ""; + }; + 8F81BF4C262908D7009C3F68 /* Support */ = { + isa = PBXGroup; + children = ( + 8F81BF4D262908F3009C3F68 /* AlertBuilder.swift */, + ); + path = Support; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8F81BF322629087C009C3F68 /* KeyboardShortcuts */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8F81BF472629087D009C3F68 /* Build configuration list for PBXNativeTarget "KeyboardShortcuts" */; + buildPhases = ( + 8F81BF2F2629087C009C3F68 /* Sources */, + 8F81BF302629087C009C3F68 /* Frameworks */, + 8F81BF312629087C009C3F68 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = KeyboardShortcuts; + productName = KeyboardShortcuts; + productReference = 8F81BF332629087C009C3F68 /* KeyboardShortcuts.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8F81BF2B2629087C009C3F68 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1240; + LastUpgradeCheck = 1240; + TargetAttributes = { + 8F81BF322629087C009C3F68 = { + CreatedOnToolsVersion = 12.4; + }; + }; + }; + buildConfigurationList = 8F81BF2E2629087C009C3F68 /* Build configuration list for PBXProject "KeyboardShortcuts" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8F81BF2A2629087C009C3F68; + productRefGroup = 8F81BF342629087C009C3F68 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8F81BF322629087C009C3F68 /* KeyboardShortcuts */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8F81BF312629087C009C3F68 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8F81BF432629087D009C3F68 /* LaunchScreen.storyboard in Resources */, + 8F81BF402629087D009C3F68 /* Assets.xcassets in Resources */, + 8F81BF3E2629087C009C3F68 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8F81BF2F2629087C009C3F68 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8F81BF4E262908F3009C3F68 /* AlertBuilder.swift in Sources */, + 8F81BF3B2629087C009C3F68 /* ViewController.swift in Sources */, + 8F81BF372629087C009C3F68 /* AppDelegate.swift in Sources */, + 8F81BF392629087C009C3F68 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 8F81BF3C2629087C009C3F68 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8F81BF3D2629087C009C3F68 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8F81BF412629087D009C3F68 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8F81BF422629087D009C3F68 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8F81BF452629087D009C3F68 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8F81BF462629087D009C3F68 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8F81BF482629087D009C3F68 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = G8C3PMN49A; + INFOPLIST_FILE = KeyboardShortcuts/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.ryangrier.KeyboardShortcuts; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 8F81BF492629087D009C3F68 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = G8C3PMN49A; + INFOPLIST_FILE = KeyboardShortcuts/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.ryangrier.KeyboardShortcuts; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8F81BF2E2629087C009C3F68 /* Build configuration list for PBXProject "KeyboardShortcuts" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8F81BF452629087D009C3F68 /* Debug */, + 8F81BF462629087D009C3F68 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8F81BF472629087D009C3F68 /* Build configuration list for PBXNativeTarget "KeyboardShortcuts" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8F81BF482629087D009C3F68 /* Debug */, + 8F81BF492629087D009C3F68 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8F81BF2B2629087C009C3F68 /* Project object */; +} diff --git a/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/KeyboardShortcuts/KeyboardShortcuts/AppDelegate.swift b/KeyboardShortcuts/KeyboardShortcuts/AppDelegate.swift new file mode 100644 index 0000000..15ea878 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/AppDelegate.swift @@ -0,0 +1,24 @@ +// +// AppDelegate.swift +// KeyboardShortcuts +// +// Created by Ryan Grier on 4/15/21. +// + +import UIKit + +@main class AppDelegate: UIResponder { } + +// MARK: - UIApplicationDelegate + +extension AppDelegate: UIApplicationDelegate { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + return true + } + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } +} diff --git a/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/AccentColor.colorset/Contents.json b/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/AppIcon.appiconset/Contents.json b/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/Contents.json b/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KeyboardShortcuts/KeyboardShortcuts/Base.lproj/LaunchScreen.storyboard b/KeyboardShortcuts/KeyboardShortcuts/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KeyboardShortcuts/KeyboardShortcuts/Base.lproj/Main.storyboard b/KeyboardShortcuts/KeyboardShortcuts/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f18b1df --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/Base.lproj/Main.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KeyboardShortcuts/KeyboardShortcuts/Info.plist b/KeyboardShortcuts/KeyboardShortcuts/Info.plist new file mode 100644 index 0000000..5b531f7 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/KeyboardShortcuts/KeyboardShortcuts/SceneDelegate.swift b/KeyboardShortcuts/KeyboardShortcuts/SceneDelegate.swift new file mode 100644 index 0000000..2840b59 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/SceneDelegate.swift @@ -0,0 +1,20 @@ +// +// SceneDelegate.swift +// KeyboardShortcuts +// +// Created by Ryan Grier on 4/15/21. +// + +import UIKit + +class SceneDelegate: UIResponder { + var window: UIWindow? +} + +// MARK: - UIWindowSceneDelegate + +extension SceneDelegate: UIWindowSceneDelegate { + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + guard let _ = (scene as? UIWindowScene) else { return } + } +} diff --git a/KeyboardShortcuts/KeyboardShortcuts/Support/AlertBuilder.swift b/KeyboardShortcuts/KeyboardShortcuts/Support/AlertBuilder.swift new file mode 100644 index 0000000..b80072c --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/Support/AlertBuilder.swift @@ -0,0 +1,62 @@ +// +// AlertBuilder.swift +// KeyboardShortcuts +// +// Created by Ryan Grier on 4/15/21. +// + +import UIKit + +class AlertBuilder { + private(set) var actions: [UIAlertAction] + private(set) var okAction: UIAlertAction? + + private(set) var title: String? + private(set) var message: String? + private(set) var style: UIAlertController.Style = .alert + + init() { + actions = [] + } + + func set(title: String? = nil, message: String? = nil) -> Self { + self.title = title + self.message = message + + return self + } + + func set(style: UIAlertController.Style) -> Self { + self.style = style + + return self + } + + func add(action: UIAlertAction) -> Self { + actions.append(action) + + return self + } + + func addOKAction(handler: ((UIAlertAction) -> Void)? = nil) -> Self { + okAction = UIAlertAction(title: NSLocalizedString("OK", comment: ""), + style: .default, + handler: handler) + + return self + } + + func build() -> UIAlertController { + let alertController = UIAlertController(title: title, message: message, preferredStyle: style) + + actions.forEach { + alertController.addAction($0) + } + + if let action = okAction { + alertController.addAction(action) + } + + return alertController + } +} diff --git a/KeyboardShortcuts/KeyboardShortcuts/View Controllers/ViewController.swift b/KeyboardShortcuts/KeyboardShortcuts/View Controllers/ViewController.swift new file mode 100644 index 0000000..6c24072 --- /dev/null +++ b/KeyboardShortcuts/KeyboardShortcuts/View Controllers/ViewController.swift @@ -0,0 +1,34 @@ +// +// ViewController.swift +// KeyboardShortcuts +// +// Created by Ryan Grier on 4/15/21. +// + +import UIKit + +class ViewController: UIViewController { + @objc private func showInfo() { + let title = NSLocalizedString("Info", comment: "") + let message = NSLocalizedString("This is the info", comment: "") + let alertController = AlertBuilder() + .set(title: title, message: message) + .addOKAction() + .build() + + present(alertController, animated: true, completion: nil) + } +} + +// MARK: - Keyboard Shortcuts + +extension ViewController { + override var keyCommands: [UIKeyCommand]? { + let infoCommand = UIKeyCommand(title: "Show Info", + action: #selector(showInfo), + input: "i", + modifierFlags: .command) + + return [infoCommand] + } +}