├── LICENSE ├── README.md ├── Shortcuts Gallery.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── rubenfernandez.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── Shortcuts Gallery ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── Model.swift ├── Utils.swift └── ViewController.swift /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Rubén Fernández 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shortcuts Gallery 2 | 3 | This app allow you to discover new Shortcuts. It uses [Sharecuts API](https://github.com/insidegui/Sharecuts/blob/master/API.md) of [Guilherme Rambo](https://twitter.com/_inside) 4 | 5 | This project is an original idea of [Marco Capano](https://twitter.com/marcocapano1) 6 | 7 | 8 | ## How to install 9 | 10 | 1. Open "Shortcuts Gallery.xcodeproj" 11 | 2. Run the app in your iPhone or iPad 12 | -------------------------------------------------------------------------------- /Shortcuts Gallery.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0C06062920F352FE0003B3E8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C06062820F352FE0003B3E8 /* AppDelegate.swift */; }; 11 | 0C06062B20F352FE0003B3E8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C06062A20F352FE0003B3E8 /* ViewController.swift */; }; 12 | 0C06062E20F352FE0003B3E8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0C06062C20F352FE0003B3E8 /* Main.storyboard */; }; 13 | 0C06063020F352FE0003B3E8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0C06062F20F352FE0003B3E8 /* Assets.xcassets */; }; 14 | 0C06063320F352FE0003B3E8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0C06063120F352FE0003B3E8 /* LaunchScreen.storyboard */; }; 15 | 0C46497E20F3535000FEC6E6 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C46497D20F3535000FEC6E6 /* Model.swift */; }; 16 | 0CF68FEB20F35F770020B15B /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CF68FEA20F35F770020B15B /* Utils.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 0C06062520F352FE0003B3E8 /* Shortcuts Gallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Shortcuts Gallery.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 0C06062820F352FE0003B3E8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | 0C06062A20F352FE0003B3E8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 23 | 0C06062D20F352FE0003B3E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | 0C06062F20F352FE0003B3E8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 0C06063220F352FE0003B3E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | 0C06063420F352FE0003B3E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | 0C46497D20F3535000FEC6E6 /* Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = ""; }; 28 | 0CF68FEA20F35F770020B15B /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 0C06062220F352FE0003B3E8 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 0C06061C20F352FE0003B3E8 = { 43 | isa = PBXGroup; 44 | children = ( 45 | 0C06062720F352FE0003B3E8 /* Shortcuts Gallery */, 46 | 0C06062620F352FE0003B3E8 /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 0C06062620F352FE0003B3E8 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 0C06062520F352FE0003B3E8 /* Shortcuts Gallery.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 0C06062720F352FE0003B3E8 /* Shortcuts Gallery */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 0C06062820F352FE0003B3E8 /* AppDelegate.swift */, 62 | 0C46497D20F3535000FEC6E6 /* Model.swift */, 63 | 0CF68FEA20F35F770020B15B /* Utils.swift */, 64 | 0C06062A20F352FE0003B3E8 /* ViewController.swift */, 65 | 0C06062C20F352FE0003B3E8 /* Main.storyboard */, 66 | 0C06062F20F352FE0003B3E8 /* Assets.xcassets */, 67 | 0C06063120F352FE0003B3E8 /* LaunchScreen.storyboard */, 68 | 0C06063420F352FE0003B3E8 /* Info.plist */, 69 | ); 70 | path = "Shortcuts Gallery"; 71 | sourceTree = ""; 72 | }; 73 | /* End PBXGroup section */ 74 | 75 | /* Begin PBXNativeTarget section */ 76 | 0C06062420F352FE0003B3E8 /* Shortcuts Gallery */ = { 77 | isa = PBXNativeTarget; 78 | buildConfigurationList = 0C06063720F352FE0003B3E8 /* Build configuration list for PBXNativeTarget "Shortcuts Gallery" */; 79 | buildPhases = ( 80 | 0C06062120F352FE0003B3E8 /* Sources */, 81 | 0C06062220F352FE0003B3E8 /* Frameworks */, 82 | 0C06062320F352FE0003B3E8 /* Resources */, 83 | ); 84 | buildRules = ( 85 | ); 86 | dependencies = ( 87 | ); 88 | name = "Shortcuts Gallery"; 89 | productName = "Shortcuts Gallery"; 90 | productReference = 0C06062520F352FE0003B3E8 /* Shortcuts Gallery.app */; 91 | productType = "com.apple.product-type.application"; 92 | }; 93 | /* End PBXNativeTarget section */ 94 | 95 | /* Begin PBXProject section */ 96 | 0C06061D20F352FE0003B3E8 /* Project object */ = { 97 | isa = PBXProject; 98 | attributes = { 99 | LastSwiftUpdateCheck = 0940; 100 | LastUpgradeCheck = 0940; 101 | ORGANIZATIONNAME = "Ruben Fernandez"; 102 | TargetAttributes = { 103 | 0C06062420F352FE0003B3E8 = { 104 | CreatedOnToolsVersion = 9.4.1; 105 | }; 106 | }; 107 | }; 108 | buildConfigurationList = 0C06062020F352FE0003B3E8 /* Build configuration list for PBXProject "Shortcuts Gallery" */; 109 | compatibilityVersion = "Xcode 9.3"; 110 | developmentRegion = en; 111 | hasScannedForEncodings = 0; 112 | knownRegions = ( 113 | en, 114 | Base, 115 | ); 116 | mainGroup = 0C06061C20F352FE0003B3E8; 117 | productRefGroup = 0C06062620F352FE0003B3E8 /* Products */; 118 | projectDirPath = ""; 119 | projectRoot = ""; 120 | targets = ( 121 | 0C06062420F352FE0003B3E8 /* Shortcuts Gallery */, 122 | ); 123 | }; 124 | /* End PBXProject section */ 125 | 126 | /* Begin PBXResourcesBuildPhase section */ 127 | 0C06062320F352FE0003B3E8 /* Resources */ = { 128 | isa = PBXResourcesBuildPhase; 129 | buildActionMask = 2147483647; 130 | files = ( 131 | 0C06063320F352FE0003B3E8 /* LaunchScreen.storyboard in Resources */, 132 | 0C06063020F352FE0003B3E8 /* Assets.xcassets in Resources */, 133 | 0C06062E20F352FE0003B3E8 /* Main.storyboard in Resources */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXResourcesBuildPhase section */ 138 | 139 | /* Begin PBXSourcesBuildPhase section */ 140 | 0C06062120F352FE0003B3E8 /* Sources */ = { 141 | isa = PBXSourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 0C46497E20F3535000FEC6E6 /* Model.swift in Sources */, 145 | 0C06062B20F352FE0003B3E8 /* ViewController.swift in Sources */, 146 | 0C06062920F352FE0003B3E8 /* AppDelegate.swift in Sources */, 147 | 0CF68FEB20F35F770020B15B /* Utils.swift in Sources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXSourcesBuildPhase section */ 152 | 153 | /* Begin PBXVariantGroup section */ 154 | 0C06062C20F352FE0003B3E8 /* Main.storyboard */ = { 155 | isa = PBXVariantGroup; 156 | children = ( 157 | 0C06062D20F352FE0003B3E8 /* Base */, 158 | ); 159 | name = Main.storyboard; 160 | sourceTree = ""; 161 | }; 162 | 0C06063120F352FE0003B3E8 /* LaunchScreen.storyboard */ = { 163 | isa = PBXVariantGroup; 164 | children = ( 165 | 0C06063220F352FE0003B3E8 /* Base */, 166 | ); 167 | name = LaunchScreen.storyboard; 168 | sourceTree = ""; 169 | }; 170 | /* End PBXVariantGroup section */ 171 | 172 | /* Begin XCBuildConfiguration section */ 173 | 0C06063520F352FE0003B3E8 /* Debug */ = { 174 | isa = XCBuildConfiguration; 175 | buildSettings = { 176 | ALWAYS_SEARCH_USER_PATHS = NO; 177 | CLANG_ANALYZER_NONNULL = YES; 178 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 179 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 180 | CLANG_CXX_LIBRARY = "libc++"; 181 | CLANG_ENABLE_MODULES = YES; 182 | CLANG_ENABLE_OBJC_ARC = YES; 183 | CLANG_ENABLE_OBJC_WEAK = YES; 184 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 185 | CLANG_WARN_BOOL_CONVERSION = YES; 186 | CLANG_WARN_COMMA = YES; 187 | CLANG_WARN_CONSTANT_CONVERSION = YES; 188 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 190 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INFINITE_RECURSION = YES; 194 | CLANG_WARN_INT_CONVERSION = YES; 195 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 196 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 197 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 198 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 199 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 200 | CLANG_WARN_STRICT_PROTOTYPES = YES; 201 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 202 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 203 | CLANG_WARN_UNREACHABLE_CODE = YES; 204 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 205 | CODE_SIGN_IDENTITY = "iPhone Developer"; 206 | COPY_PHASE_STRIP = NO; 207 | DEBUG_INFORMATION_FORMAT = dwarf; 208 | ENABLE_STRICT_OBJC_MSGSEND = YES; 209 | ENABLE_TESTABILITY = YES; 210 | GCC_C_LANGUAGE_STANDARD = gnu11; 211 | GCC_DYNAMIC_NO_PIC = NO; 212 | GCC_NO_COMMON_BLOCKS = YES; 213 | GCC_OPTIMIZATION_LEVEL = 0; 214 | GCC_PREPROCESSOR_DEFINITIONS = ( 215 | "DEBUG=1", 216 | "$(inherited)", 217 | ); 218 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 219 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 220 | GCC_WARN_UNDECLARED_SELECTOR = YES; 221 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 222 | GCC_WARN_UNUSED_FUNCTION = YES; 223 | GCC_WARN_UNUSED_VARIABLE = YES; 224 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 225 | MTL_ENABLE_DEBUG_INFO = YES; 226 | ONLY_ACTIVE_ARCH = YES; 227 | SDKROOT = iphoneos; 228 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 229 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 230 | }; 231 | name = Debug; 232 | }; 233 | 0C06063620F352FE0003B3E8 /* Release */ = { 234 | isa = XCBuildConfiguration; 235 | buildSettings = { 236 | ALWAYS_SEARCH_USER_PATHS = NO; 237 | CLANG_ANALYZER_NONNULL = YES; 238 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_ENABLE_OBJC_WEAK = YES; 244 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 245 | CLANG_WARN_BOOL_CONVERSION = YES; 246 | CLANG_WARN_COMMA = YES; 247 | CLANG_WARN_CONSTANT_CONVERSION = YES; 248 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 250 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN_ENUM_CONVERSION = YES; 253 | CLANG_WARN_INFINITE_RECURSION = YES; 254 | CLANG_WARN_INT_CONVERSION = YES; 255 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 257 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 258 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 259 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 260 | CLANG_WARN_STRICT_PROTOTYPES = YES; 261 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 262 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 263 | CLANG_WARN_UNREACHABLE_CODE = YES; 264 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 265 | CODE_SIGN_IDENTITY = "iPhone Developer"; 266 | COPY_PHASE_STRIP = NO; 267 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 268 | ENABLE_NS_ASSERTIONS = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | GCC_C_LANGUAGE_STANDARD = gnu11; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 274 | GCC_WARN_UNDECLARED_SELECTOR = YES; 275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 276 | GCC_WARN_UNUSED_FUNCTION = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 279 | MTL_ENABLE_DEBUG_INFO = NO; 280 | SDKROOT = iphoneos; 281 | SWIFT_COMPILATION_MODE = wholemodule; 282 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 283 | VALIDATE_PRODUCT = YES; 284 | }; 285 | name = Release; 286 | }; 287 | 0C06063820F352FE0003B3E8 /* Debug */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | CODE_SIGN_STYLE = Automatic; 292 | DEVELOPMENT_TEAM = M92GJ8T2S2; 293 | INFOPLIST_FILE = "Shortcuts Gallery/Info.plist"; 294 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 295 | LD_RUNPATH_SEARCH_PATHS = ( 296 | "$(inherited)", 297 | "@executable_path/Frameworks", 298 | ); 299 | PRODUCT_BUNDLE_IDENTIFIER = "com.rubenfernandez.Shortcuts-Gallery"; 300 | PRODUCT_NAME = "$(TARGET_NAME)"; 301 | SWIFT_VERSION = 4.0; 302 | TARGETED_DEVICE_FAMILY = "1,2"; 303 | }; 304 | name = Debug; 305 | }; 306 | 0C06063920F352FE0003B3E8 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | CODE_SIGN_STYLE = Automatic; 311 | DEVELOPMENT_TEAM = M92GJ8T2S2; 312 | INFOPLIST_FILE = "Shortcuts Gallery/Info.plist"; 313 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 314 | LD_RUNPATH_SEARCH_PATHS = ( 315 | "$(inherited)", 316 | "@executable_path/Frameworks", 317 | ); 318 | PRODUCT_BUNDLE_IDENTIFIER = "com.rubenfernandez.Shortcuts-Gallery"; 319 | PRODUCT_NAME = "$(TARGET_NAME)"; 320 | SWIFT_VERSION = 4.0; 321 | TARGETED_DEVICE_FAMILY = "1,2"; 322 | }; 323 | name = Release; 324 | }; 325 | /* End XCBuildConfiguration section */ 326 | 327 | /* Begin XCConfigurationList section */ 328 | 0C06062020F352FE0003B3E8 /* Build configuration list for PBXProject "Shortcuts Gallery" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | 0C06063520F352FE0003B3E8 /* Debug */, 332 | 0C06063620F352FE0003B3E8 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | 0C06063720F352FE0003B3E8 /* Build configuration list for PBXNativeTarget "Shortcuts Gallery" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | 0C06063820F352FE0003B3E8 /* Debug */, 341 | 0C06063920F352FE0003B3E8 /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | /* End XCConfigurationList section */ 347 | }; 348 | rootObject = 0C06061D20F352FE0003B3E8 /* Project object */; 349 | } 350 | -------------------------------------------------------------------------------- /Shortcuts Gallery.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Shortcuts Gallery.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Shortcuts Gallery.xcodeproj/xcuserdata/rubenfernandez.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Shortcuts Gallery.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Shortcuts Gallery/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Shortcuts Gallery 4 | // 5 | // Created by Ruben Fernandez on 09/07/2018. 6 | // Copyright © 2018 Ruben Fernandez. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Shortcuts Gallery/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Shortcuts Gallery/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Shortcuts Gallery/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 | -------------------------------------------------------------------------------- /Shortcuts Gallery/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 | 35 | 42 | 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 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Shortcuts Gallery/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeRight 35 | UIInterfaceOrientationLandscapeLeft 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Shortcuts Gallery/Model.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Model.swift 3 | // Shortcuts Gallery 4 | // 5 | // Created by Ruben Fernandez on 09/07/2018. 6 | // Copyright © 2018 Ruben Fernandez. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DiscoverShortcuts: Codable { 12 | var count: Int! 13 | var results: [ShortcutResult]! 14 | } 15 | 16 | class ShortcutResult: Codable { 17 | var summary: String! 18 | var userID: String! 19 | var fileID: String! 20 | var id: String! 21 | var actionIdentifiers: [String]! 22 | var title: String! 23 | var updatedAt: String! 24 | var createdAt: String! 25 | var filePath: String! 26 | var actionCount: Int! 27 | } 28 | 29 | class ShortcutDetail: Codable { 30 | var shortcut: ShortcutResult! 31 | var deepLink: String! 32 | var download: String! 33 | var user: ShortcutUser! 34 | } 35 | 36 | class ShortcutUser: Codable { 37 | var username: String! 38 | var id: String! 39 | var name: String! 40 | var url: String! 41 | } 42 | -------------------------------------------------------------------------------- /Shortcuts Gallery/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // Shortcuts Gallery 4 | // 5 | // Created by Ruben Fernandez on 09/07/2018. 6 | // Copyright © 2018 Ruben Fernandez. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Utils { 12 | 13 | func getShortcuts() -> DiscoverShortcuts { 14 | var shortcuts: DiscoverShortcuts! 15 | let dispatchGroup = DispatchGroup() 16 | let url = URL(string: "https://sharecuts.app/api/shortcuts/latest") 17 | dispatchGroup.enter() 18 | if let url = url { 19 | let task = URLSession.shared.dataTask(with: url) { (data, response, error) in 20 | if error != nil { 21 | print(error!) 22 | } else { 23 | if let data = data { 24 | do { 25 | shortcuts = try JSONDecoder().decode(DiscoverShortcuts.self, from: data) 26 | } catch { 27 | print(error.localizedDescription) 28 | } 29 | } 30 | dispatchGroup.leave() 31 | } 32 | } 33 | task.resume() 34 | } 35 | dispatchGroup.wait() 36 | return shortcuts 37 | } 38 | 39 | func getShortcutDetail(id: String) -> ShortcutDetail { 40 | var shortcutDetail: ShortcutDetail! 41 | let shortcutDetailURL = "https://sharecuts.app/api/shortcuts/" + id 42 | let dispatchGroup = DispatchGroup() 43 | dispatchGroup.enter() 44 | if let url = URL(string: shortcutDetailURL) { 45 | let task = URLSession.shared.dataTask(with: url) { (data, response, error) in 46 | if error != nil { 47 | print(error!) 48 | } else { 49 | if let data = data { 50 | do { 51 | shortcutDetail = try JSONDecoder().decode(ShortcutDetail.self, from: data) 52 | } catch { 53 | print(error.localizedDescription) 54 | } 55 | } 56 | dispatchGroup.leave() 57 | } 58 | } 59 | task.resume() 60 | } 61 | dispatchGroup.wait() 62 | return shortcutDetail 63 | } 64 | 65 | func searchShortcuts(keyword: String) -> DiscoverShortcuts { 66 | if keyword == "" { 67 | return getShortcuts() 68 | } else { 69 | #warning("Waiting to search feature release") 70 | 71 | return getShortcuts() 72 | } 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /Shortcuts Gallery/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Shortcuts Gallery 4 | // 5 | // Created by Ruben Fernandez on 09/07/2018. 6 | // Copyright © 2018 Ruben Fernandez. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UITableViewController { 12 | 13 | var shortcuts: DiscoverShortcuts? 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | navigationController?.navigationBar.prefersLargeTitles = true 18 | tableView.rowHeight = UITableViewAutomaticDimension 19 | tableView.estimatedRowHeight = 70 20 | shortcuts = Utils().getShortcuts() 21 | tableView.reloadData() 22 | } 23 | 24 | @IBAction func searchBtn(_ sender: Any) { 25 | let alert = UIAlertController(title: "Search Shortcuts", message: "", preferredStyle: .alert) 26 | alert.addTextField(configurationHandler: { (textField) in 27 | textField.placeholder = "Text to search" 28 | }) 29 | let searchAction = UIAlertAction(title: "Search", style: .default) { Void in 30 | let textToSearch = alert.textFields?.first?.text 31 | self.shortcuts = Utils().searchShortcuts(keyword: textToSearch!) 32 | self.tableView.reloadData() 33 | } 34 | alert.addAction(searchAction) 35 | alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) 36 | self.present(alert, animated: true) 37 | } 38 | 39 | } 40 | 41 | extension ViewController { // TableView config 42 | 43 | override func numberOfSections(in tableView: UITableView) -> Int { 44 | return 1 45 | } 46 | 47 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 48 | if let shortcuts = shortcuts { 49 | return shortcuts.count 50 | } 51 | return 0 52 | } 53 | 54 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 55 | let cell = UITableViewCell(style: .subtitle, reuseIdentifier: "cell") 56 | cell.textLabel?.text = shortcuts?.results[indexPath.row].title 57 | cell.detailTextLabel?.text = shortcuts?.results[indexPath.row].summary 58 | cell.detailTextLabel?.numberOfLines = 0 59 | return cell 60 | } 61 | 62 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 63 | let alert = UIAlertController(title: "Do you want to add this shortcut?", message: "This shortcut have \(shortcuts?.results[indexPath.row].actionCount ?? 0) actions", preferredStyle: .alert) 64 | let addBtn = UIAlertAction(title: "Yes", style: .default) { Void in 65 | let shortcutID = self.shortcuts?.results[indexPath.row].id 66 | let shortcutDetail = Utils().getShortcutDetail(id: shortcutID!) 67 | let deepLink = URL(string: shortcutDetail.deepLink) 68 | UIApplication.shared.open(deepLink!, options: [:], completionHandler: nil) 69 | } 70 | alert.addAction(addBtn) 71 | alert.addAction(UIAlertAction(title: "No", style: .cancel, handler: nil)) 72 | self.present(alert, animated: true) 73 | tableView.deselectRow(at: indexPath, animated: true) 74 | } 75 | 76 | } 77 | --------------------------------------------------------------------------------