├── .gitignore ├── .travis.yml ├── ARDeepLinkButton.podspec ├── ARDeepLinkButton.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── ARDeepLinkButton.xcscheme │ └── ARDeepLinkButtonExample.xcscheme ├── ARDeepLinkButton ├── ARDeepLinkButton.h ├── ARDeepLinkButton.swift ├── ARDeepLinkHandler.swift └── Info.plist ├── ARDeepLinkButtonExample ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── MADBikeIcon.imageset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ └── Icon-60@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── ARDeepLinkButtonExampleUITests ├── ARDeepLinkButtonExampleUITests.swift └── Info.plist ├── ARDeepLinkButtonTests ├── ARDeepLinkButtonTests.swift ├── ARDeepLinkHandlerTests.swift └── Info.plist ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Package.swift ├── README.md └── screenshot.png /.gitignore: -------------------------------------------------------------------------------- 1 | ## Build generated 2 | build/ 3 | DerivedData/ 4 | 5 | ## Various settings 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | 16 | ## Other 17 | *.moved-aside 18 | *.xccheckout 19 | *.xcscmblueprint 20 | 21 | ## Obj-C/Swift specific 22 | *.hmap 23 | *.ipa 24 | 25 | ## Playgrounds 26 | timeline.xctimeline 27 | playground.xcworkspace 28 | 29 | # Swift Package Manager 30 | # 31 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 32 | # Packages/ 33 | .build/ 34 | 35 | # CocoaPods 36 | # 37 | # We recommend against adding the Pods directory to your .gitignore. However 38 | # you should judge for yourself, the pros and cons are mentioned at: 39 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 40 | # 41 | # Pods/ 42 | 43 | # Carthage 44 | # 45 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 46 | # Carthage/Checkouts 47 | 48 | Carthage/Build 49 | 50 | # fastlane 51 | # 52 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 53 | # screenshots whenever they are needed. 54 | # For more information about the recommended setup visit: 55 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 56 | 57 | fastlane/report.xml 58 | fastlane/screenshots -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | xcode_project: ARDeepLinkButton.xcodeproj 3 | xcode_scheme: ARDeepLinkButton 4 | osx_image: xcode7.2 5 | xcode_sdk: iphonesimulator9.3 6 | -------------------------------------------------------------------------------- /ARDeepLinkButton.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ARDeepLinkButton" 3 | s.version = "1.0.1" 4 | s.summary = "#UIButton subclass that handle deep links, shows in-app #SKStoreProductViewController or redirects to the #AppStore. Written in #Swift 2.0" 5 | s.homepage = "https://github.com/alexruperez/ARDeepLinkButton" 6 | s.screenshots = "https://raw.githubusercontent.com/alexruperez/ARDeepLinkButton/master/screenshot.png" 7 | s.license = "MIT" 8 | s.author = { "Alex Rupérez" => "contact@alexruperez.com" } 9 | s.social_media_url = "http://twitter.com/alexruperez" 10 | s.platform = :ios, "9.0" 11 | s.source = { :git => "https://github.com/alexruperez/ARDeepLinkButton.git", :tag => s.version.to_s } 12 | s.source_files = "ARDeepLinkButton/**/*.{h,m,swift}" 13 | s.public_header_files = "ARDeepLinkButton/**/*.h" 14 | s.frameworks = "UIKit", "StoreKit" 15 | s.requires_arc = true 16 | end 17 | -------------------------------------------------------------------------------- /ARDeepLinkButton.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D572CD6C1C5E2F400082D870 /* ARDeepLinkButton.h in Headers */ = {isa = PBXBuildFile; fileRef = D572CD6B1C5E2F400082D870 /* ARDeepLinkButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | D572CD731C5E2F400082D870 /* ARDeepLinkButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D572CD681C5E2F400082D870 /* ARDeepLinkButton.framework */; }; 12 | D572CD781C5E2F400082D870 /* ARDeepLinkButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D572CD771C5E2F400082D870 /* ARDeepLinkButtonTests.swift */; }; 13 | D572CD831C5E2FCC0082D870 /* ARDeepLinkButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D572CD821C5E2FCC0082D870 /* ARDeepLinkButton.swift */; }; 14 | D572CD8B1C5E30450082D870 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D572CD8A1C5E30450082D870 /* AppDelegate.swift */; }; 15 | D572CD8D1C5E30450082D870 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D572CD8C1C5E30450082D870 /* ViewController.swift */; }; 16 | D572CD901C5E30450082D870 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D572CD8E1C5E30450082D870 /* Main.storyboard */; }; 17 | D572CD951C5E30450082D870 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D572CD941C5E30450082D870 /* Assets.xcassets */; }; 18 | D572CD981C5E30450082D870 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D572CD961C5E30450082D870 /* LaunchScreen.storyboard */; }; 19 | D572CDAE1C5E30450082D870 /* ARDeepLinkButtonExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D572CDAD1C5E30450082D870 /* ARDeepLinkButtonExampleUITests.swift */; }; 20 | D572CDBB1C5E35AD0082D870 /* ARDeepLinkButton.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D572CD681C5E2F400082D870 /* ARDeepLinkButton.framework */; }; 21 | D572CDBC1C5E35AD0082D870 /* ARDeepLinkButton.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D572CD681C5E2F400082D870 /* ARDeepLinkButton.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 22 | D572CDBF1C5E4A0F0082D870 /* ARDeepLinkHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D572CDBE1C5E4A0F0082D870 /* ARDeepLinkHandler.swift */; }; 23 | D572CDC11C5E661C0082D870 /* ARDeepLinkHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D572CDC01C5E661C0082D870 /* ARDeepLinkHandlerTests.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | D572CD741C5E2F400082D870 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = D572CD5F1C5E2F400082D870 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = D572CD671C5E2F400082D870; 32 | remoteInfo = ARDeepLinkButton; 33 | }; 34 | D572CDAA1C5E30450082D870 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = D572CD5F1C5E2F400082D870 /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = D572CD871C5E30450082D870; 39 | remoteInfo = ARDeepLinkButtonExample; 40 | }; 41 | D572CDB91C5E35A20082D870 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = D572CD5F1C5E2F400082D870 /* Project object */; 44 | proxyType = 1; 45 | remoteGlobalIDString = D572CD671C5E2F400082D870; 46 | remoteInfo = ARDeepLinkButton; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXCopyFilesBuildPhase section */ 51 | D572CDBD1C5E35AE0082D870 /* Embed Frameworks */ = { 52 | isa = PBXCopyFilesBuildPhase; 53 | buildActionMask = 2147483647; 54 | dstPath = ""; 55 | dstSubfolderSpec = 10; 56 | files = ( 57 | D572CDBC1C5E35AD0082D870 /* ARDeepLinkButton.framework in Embed Frameworks */, 58 | ); 59 | name = "Embed Frameworks"; 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXCopyFilesBuildPhase section */ 63 | 64 | /* Begin PBXFileReference section */ 65 | D572CD681C5E2F400082D870 /* ARDeepLinkButton.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ARDeepLinkButton.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | D572CD6B1C5E2F400082D870 /* ARDeepLinkButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ARDeepLinkButton.h; sourceTree = ""; }; 67 | D572CD6D1C5E2F400082D870 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 68 | D572CD721C5E2F400082D870 /* ARDeepLinkButtonTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ARDeepLinkButtonTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | D572CD771C5E2F400082D870 /* ARDeepLinkButtonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARDeepLinkButtonTests.swift; sourceTree = ""; }; 70 | D572CD791C5E2F400082D870 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 71 | D572CD821C5E2FCC0082D870 /* ARDeepLinkButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ARDeepLinkButton.swift; sourceTree = ""; }; 72 | D572CD881C5E30450082D870 /* ARDeepLinkButtonExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ARDeepLinkButtonExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | D572CD8A1C5E30450082D870 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 74 | D572CD8C1C5E30450082D870 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 75 | D572CD8F1C5E30450082D870 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 76 | D572CD941C5E30450082D870 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 77 | D572CD971C5E30450082D870 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 78 | D572CD991C5E30450082D870 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79 | D572CDA91C5E30450082D870 /* ARDeepLinkButtonExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ARDeepLinkButtonExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | D572CDAD1C5E30450082D870 /* ARDeepLinkButtonExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARDeepLinkButtonExampleUITests.swift; sourceTree = ""; }; 81 | D572CDAF1C5E30450082D870 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 82 | D572CDBE1C5E4A0F0082D870 /* ARDeepLinkHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ARDeepLinkHandler.swift; sourceTree = ""; }; 83 | D572CDC01C5E661C0082D870 /* ARDeepLinkHandlerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ARDeepLinkHandlerTests.swift; sourceTree = ""; }; 84 | /* End PBXFileReference section */ 85 | 86 | /* Begin PBXFrameworksBuildPhase section */ 87 | D572CD641C5E2F400082D870 /* Frameworks */ = { 88 | isa = PBXFrameworksBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | ); 92 | runOnlyForDeploymentPostprocessing = 0; 93 | }; 94 | D572CD6F1C5E2F400082D870 /* Frameworks */ = { 95 | isa = PBXFrameworksBuildPhase; 96 | buildActionMask = 2147483647; 97 | files = ( 98 | D572CD731C5E2F400082D870 /* ARDeepLinkButton.framework in Frameworks */, 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | D572CD851C5E30450082D870 /* Frameworks */ = { 103 | isa = PBXFrameworksBuildPhase; 104 | buildActionMask = 2147483647; 105 | files = ( 106 | D572CDBB1C5E35AD0082D870 /* ARDeepLinkButton.framework in Frameworks */, 107 | ); 108 | runOnlyForDeploymentPostprocessing = 0; 109 | }; 110 | D572CDA61C5E30450082D870 /* Frameworks */ = { 111 | isa = PBXFrameworksBuildPhase; 112 | buildActionMask = 2147483647; 113 | files = ( 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | /* End PBXFrameworksBuildPhase section */ 118 | 119 | /* Begin PBXGroup section */ 120 | D572CD5E1C5E2F400082D870 = { 121 | isa = PBXGroup; 122 | children = ( 123 | D572CD6A1C5E2F400082D870 /* ARDeepLinkButton */, 124 | D572CD761C5E2F400082D870 /* ARDeepLinkButtonTests */, 125 | D572CD891C5E30450082D870 /* ARDeepLinkButtonExample */, 126 | D572CDAC1C5E30450082D870 /* ARDeepLinkButtonExampleUITests */, 127 | D572CD691C5E2F400082D870 /* Products */, 128 | ); 129 | sourceTree = ""; 130 | }; 131 | D572CD691C5E2F400082D870 /* Products */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | D572CD681C5E2F400082D870 /* ARDeepLinkButton.framework */, 135 | D572CD721C5E2F400082D870 /* ARDeepLinkButtonTests.xctest */, 136 | D572CD881C5E30450082D870 /* ARDeepLinkButtonExample.app */, 137 | D572CDA91C5E30450082D870 /* ARDeepLinkButtonExampleUITests.xctest */, 138 | ); 139 | name = Products; 140 | sourceTree = ""; 141 | }; 142 | D572CD6A1C5E2F400082D870 /* ARDeepLinkButton */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | D572CD6B1C5E2F400082D870 /* ARDeepLinkButton.h */, 146 | D572CD821C5E2FCC0082D870 /* ARDeepLinkButton.swift */, 147 | D572CDBE1C5E4A0F0082D870 /* ARDeepLinkHandler.swift */, 148 | D572CD6D1C5E2F400082D870 /* Info.plist */, 149 | ); 150 | path = ARDeepLinkButton; 151 | sourceTree = ""; 152 | }; 153 | D572CD761C5E2F400082D870 /* ARDeepLinkButtonTests */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | D572CD771C5E2F400082D870 /* ARDeepLinkButtonTests.swift */, 157 | D572CDC01C5E661C0082D870 /* ARDeepLinkHandlerTests.swift */, 158 | D572CD791C5E2F400082D870 /* Info.plist */, 159 | ); 160 | path = ARDeepLinkButtonTests; 161 | sourceTree = ""; 162 | }; 163 | D572CD891C5E30450082D870 /* ARDeepLinkButtonExample */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | D572CD8A1C5E30450082D870 /* AppDelegate.swift */, 167 | D572CD8C1C5E30450082D870 /* ViewController.swift */, 168 | D572CD8E1C5E30450082D870 /* Main.storyboard */, 169 | D572CD941C5E30450082D870 /* Assets.xcassets */, 170 | D572CD961C5E30450082D870 /* LaunchScreen.storyboard */, 171 | D572CD991C5E30450082D870 /* Info.plist */, 172 | ); 173 | path = ARDeepLinkButtonExample; 174 | sourceTree = ""; 175 | }; 176 | D572CDAC1C5E30450082D870 /* ARDeepLinkButtonExampleUITests */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | D572CDAD1C5E30450082D870 /* ARDeepLinkButtonExampleUITests.swift */, 180 | D572CDAF1C5E30450082D870 /* Info.plist */, 181 | ); 182 | path = ARDeepLinkButtonExampleUITests; 183 | sourceTree = ""; 184 | }; 185 | /* End PBXGroup section */ 186 | 187 | /* Begin PBXHeadersBuildPhase section */ 188 | D572CD651C5E2F400082D870 /* Headers */ = { 189 | isa = PBXHeadersBuildPhase; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | D572CD6C1C5E2F400082D870 /* ARDeepLinkButton.h in Headers */, 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | /* End PBXHeadersBuildPhase section */ 197 | 198 | /* Begin PBXNativeTarget section */ 199 | D572CD671C5E2F400082D870 /* ARDeepLinkButton */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = D572CD7C1C5E2F400082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButton" */; 202 | buildPhases = ( 203 | D572CD631C5E2F400082D870 /* Sources */, 204 | D572CD641C5E2F400082D870 /* Frameworks */, 205 | D572CD651C5E2F400082D870 /* Headers */, 206 | D572CD661C5E2F400082D870 /* Resources */, 207 | ); 208 | buildRules = ( 209 | ); 210 | dependencies = ( 211 | ); 212 | name = ARDeepLinkButton; 213 | productName = ARDeepLinkButton; 214 | productReference = D572CD681C5E2F400082D870 /* ARDeepLinkButton.framework */; 215 | productType = "com.apple.product-type.framework"; 216 | }; 217 | D572CD711C5E2F400082D870 /* ARDeepLinkButtonTests */ = { 218 | isa = PBXNativeTarget; 219 | buildConfigurationList = D572CD7F1C5E2F400082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButtonTests" */; 220 | buildPhases = ( 221 | D572CD6E1C5E2F400082D870 /* Sources */, 222 | D572CD6F1C5E2F400082D870 /* Frameworks */, 223 | D572CD701C5E2F400082D870 /* Resources */, 224 | ); 225 | buildRules = ( 226 | ); 227 | dependencies = ( 228 | D572CD751C5E2F400082D870 /* PBXTargetDependency */, 229 | ); 230 | name = ARDeepLinkButtonTests; 231 | productName = ARDeepLinkButtonTests; 232 | productReference = D572CD721C5E2F400082D870 /* ARDeepLinkButtonTests.xctest */; 233 | productType = "com.apple.product-type.bundle.unit-test"; 234 | }; 235 | D572CD871C5E30450082D870 /* ARDeepLinkButtonExample */ = { 236 | isa = PBXNativeTarget; 237 | buildConfigurationList = D572CDB01C5E30450082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButtonExample" */; 238 | buildPhases = ( 239 | D572CD841C5E30450082D870 /* Sources */, 240 | D572CD851C5E30450082D870 /* Frameworks */, 241 | D572CD861C5E30450082D870 /* Resources */, 242 | D572CDBD1C5E35AE0082D870 /* Embed Frameworks */, 243 | ); 244 | buildRules = ( 245 | ); 246 | dependencies = ( 247 | D572CDBA1C5E35A20082D870 /* PBXTargetDependency */, 248 | ); 249 | name = ARDeepLinkButtonExample; 250 | productName = ARDeepLinkButtonExample; 251 | productReference = D572CD881C5E30450082D870 /* ARDeepLinkButtonExample.app */; 252 | productType = "com.apple.product-type.application"; 253 | }; 254 | D572CDA81C5E30450082D870 /* ARDeepLinkButtonExampleUITests */ = { 255 | isa = PBXNativeTarget; 256 | buildConfigurationList = D572CDB61C5E30450082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButtonExampleUITests" */; 257 | buildPhases = ( 258 | D572CDA51C5E30450082D870 /* Sources */, 259 | D572CDA61C5E30450082D870 /* Frameworks */, 260 | D572CDA71C5E30450082D870 /* Resources */, 261 | ); 262 | buildRules = ( 263 | ); 264 | dependencies = ( 265 | D572CDAB1C5E30450082D870 /* PBXTargetDependency */, 266 | ); 267 | name = ARDeepLinkButtonExampleUITests; 268 | productName = ARDeepLinkButtonExampleUITests; 269 | productReference = D572CDA91C5E30450082D870 /* ARDeepLinkButtonExampleUITests.xctest */; 270 | productType = "com.apple.product-type.bundle.ui-testing"; 271 | }; 272 | /* End PBXNativeTarget section */ 273 | 274 | /* Begin PBXProject section */ 275 | D572CD5F1C5E2F400082D870 /* Project object */ = { 276 | isa = PBXProject; 277 | attributes = { 278 | LastSwiftUpdateCheck = 0720; 279 | LastUpgradeCheck = 0720; 280 | ORGANIZATIONNAME = alexruperez; 281 | TargetAttributes = { 282 | D572CD671C5E2F400082D870 = { 283 | CreatedOnToolsVersion = 7.2; 284 | }; 285 | D572CD711C5E2F400082D870 = { 286 | CreatedOnToolsVersion = 7.2; 287 | }; 288 | D572CD871C5E30450082D870 = { 289 | CreatedOnToolsVersion = 7.2; 290 | }; 291 | D572CDA81C5E30450082D870 = { 292 | CreatedOnToolsVersion = 7.2; 293 | TestTargetID = D572CD871C5E30450082D870; 294 | }; 295 | }; 296 | }; 297 | buildConfigurationList = D572CD621C5E2F400082D870 /* Build configuration list for PBXProject "ARDeepLinkButton" */; 298 | compatibilityVersion = "Xcode 3.2"; 299 | developmentRegion = English; 300 | hasScannedForEncodings = 0; 301 | knownRegions = ( 302 | en, 303 | Base, 304 | ); 305 | mainGroup = D572CD5E1C5E2F400082D870; 306 | productRefGroup = D572CD691C5E2F400082D870 /* Products */; 307 | projectDirPath = ""; 308 | projectRoot = ""; 309 | targets = ( 310 | D572CD671C5E2F400082D870 /* ARDeepLinkButton */, 311 | D572CD711C5E2F400082D870 /* ARDeepLinkButtonTests */, 312 | D572CD871C5E30450082D870 /* ARDeepLinkButtonExample */, 313 | D572CDA81C5E30450082D870 /* ARDeepLinkButtonExampleUITests */, 314 | ); 315 | }; 316 | /* End PBXProject section */ 317 | 318 | /* Begin PBXResourcesBuildPhase section */ 319 | D572CD661C5E2F400082D870 /* Resources */ = { 320 | isa = PBXResourcesBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | D572CD701C5E2F400082D870 /* Resources */ = { 327 | isa = PBXResourcesBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | D572CD861C5E30450082D870 /* Resources */ = { 334 | isa = PBXResourcesBuildPhase; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | D572CD981C5E30450082D870 /* LaunchScreen.storyboard in Resources */, 338 | D572CD951C5E30450082D870 /* Assets.xcassets in Resources */, 339 | D572CD901C5E30450082D870 /* Main.storyboard in Resources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | D572CDA71C5E30450082D870 /* Resources */ = { 344 | isa = PBXResourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | }; 350 | /* End PBXResourcesBuildPhase section */ 351 | 352 | /* Begin PBXSourcesBuildPhase section */ 353 | D572CD631C5E2F400082D870 /* Sources */ = { 354 | isa = PBXSourcesBuildPhase; 355 | buildActionMask = 2147483647; 356 | files = ( 357 | D572CD831C5E2FCC0082D870 /* ARDeepLinkButton.swift in Sources */, 358 | D572CDBF1C5E4A0F0082D870 /* ARDeepLinkHandler.swift in Sources */, 359 | ); 360 | runOnlyForDeploymentPostprocessing = 0; 361 | }; 362 | D572CD6E1C5E2F400082D870 /* Sources */ = { 363 | isa = PBXSourcesBuildPhase; 364 | buildActionMask = 2147483647; 365 | files = ( 366 | D572CD781C5E2F400082D870 /* ARDeepLinkButtonTests.swift in Sources */, 367 | D572CDC11C5E661C0082D870 /* ARDeepLinkHandlerTests.swift in Sources */, 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | }; 371 | D572CD841C5E30450082D870 /* Sources */ = { 372 | isa = PBXSourcesBuildPhase; 373 | buildActionMask = 2147483647; 374 | files = ( 375 | D572CD8D1C5E30450082D870 /* ViewController.swift in Sources */, 376 | D572CD8B1C5E30450082D870 /* AppDelegate.swift in Sources */, 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | }; 380 | D572CDA51C5E30450082D870 /* Sources */ = { 381 | isa = PBXSourcesBuildPhase; 382 | buildActionMask = 2147483647; 383 | files = ( 384 | D572CDAE1C5E30450082D870 /* ARDeepLinkButtonExampleUITests.swift in Sources */, 385 | ); 386 | runOnlyForDeploymentPostprocessing = 0; 387 | }; 388 | /* End PBXSourcesBuildPhase section */ 389 | 390 | /* Begin PBXTargetDependency section */ 391 | D572CD751C5E2F400082D870 /* PBXTargetDependency */ = { 392 | isa = PBXTargetDependency; 393 | target = D572CD671C5E2F400082D870 /* ARDeepLinkButton */; 394 | targetProxy = D572CD741C5E2F400082D870 /* PBXContainerItemProxy */; 395 | }; 396 | D572CDAB1C5E30450082D870 /* PBXTargetDependency */ = { 397 | isa = PBXTargetDependency; 398 | target = D572CD871C5E30450082D870 /* ARDeepLinkButtonExample */; 399 | targetProxy = D572CDAA1C5E30450082D870 /* PBXContainerItemProxy */; 400 | }; 401 | D572CDBA1C5E35A20082D870 /* PBXTargetDependency */ = { 402 | isa = PBXTargetDependency; 403 | target = D572CD671C5E2F400082D870 /* ARDeepLinkButton */; 404 | targetProxy = D572CDB91C5E35A20082D870 /* PBXContainerItemProxy */; 405 | }; 406 | /* End PBXTargetDependency section */ 407 | 408 | /* Begin PBXVariantGroup section */ 409 | D572CD8E1C5E30450082D870 /* Main.storyboard */ = { 410 | isa = PBXVariantGroup; 411 | children = ( 412 | D572CD8F1C5E30450082D870 /* Base */, 413 | ); 414 | name = Main.storyboard; 415 | sourceTree = ""; 416 | }; 417 | D572CD961C5E30450082D870 /* LaunchScreen.storyboard */ = { 418 | isa = PBXVariantGroup; 419 | children = ( 420 | D572CD971C5E30450082D870 /* Base */, 421 | ); 422 | name = LaunchScreen.storyboard; 423 | sourceTree = ""; 424 | }; 425 | /* End PBXVariantGroup section */ 426 | 427 | /* Begin XCBuildConfiguration section */ 428 | D572CD7A1C5E2F400082D870 /* Debug */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 433 | CLANG_CXX_LIBRARY = "libc++"; 434 | CLANG_ENABLE_MODULES = YES; 435 | CLANG_ENABLE_OBJC_ARC = YES; 436 | CLANG_WARN_BOOL_CONVERSION = YES; 437 | CLANG_WARN_CONSTANT_CONVERSION = YES; 438 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 439 | CLANG_WARN_EMPTY_BODY = YES; 440 | CLANG_WARN_ENUM_CONVERSION = YES; 441 | CLANG_WARN_INT_CONVERSION = YES; 442 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 443 | CLANG_WARN_UNREACHABLE_CODE = YES; 444 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 445 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 446 | COPY_PHASE_STRIP = NO; 447 | CURRENT_PROJECT_VERSION = 1.0.1; 448 | DEBUG_INFORMATION_FORMAT = dwarf; 449 | ENABLE_STRICT_OBJC_MSGSEND = YES; 450 | ENABLE_TESTABILITY = YES; 451 | GCC_C_LANGUAGE_STANDARD = gnu99; 452 | GCC_DYNAMIC_NO_PIC = NO; 453 | GCC_NO_COMMON_BLOCKS = YES; 454 | GCC_OPTIMIZATION_LEVEL = 0; 455 | GCC_PREPROCESSOR_DEFINITIONS = ( 456 | "DEBUG=1", 457 | "$(inherited)", 458 | ); 459 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 460 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 461 | GCC_WARN_UNDECLARED_SELECTOR = YES; 462 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 463 | GCC_WARN_UNUSED_FUNCTION = YES; 464 | GCC_WARN_UNUSED_VARIABLE = YES; 465 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 466 | MTL_ENABLE_DEBUG_INFO = YES; 467 | ONLY_ACTIVE_ARCH = YES; 468 | SDKROOT = iphoneos; 469 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 470 | TARGETED_DEVICE_FAMILY = "1,2"; 471 | VERSIONING_SYSTEM = "apple-generic"; 472 | VERSION_INFO_PREFIX = ""; 473 | }; 474 | name = Debug; 475 | }; 476 | D572CD7B1C5E2F400082D870 /* Release */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | ALWAYS_SEARCH_USER_PATHS = NO; 480 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 481 | CLANG_CXX_LIBRARY = "libc++"; 482 | CLANG_ENABLE_MODULES = YES; 483 | CLANG_ENABLE_OBJC_ARC = YES; 484 | CLANG_WARN_BOOL_CONVERSION = YES; 485 | CLANG_WARN_CONSTANT_CONVERSION = YES; 486 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 487 | CLANG_WARN_EMPTY_BODY = YES; 488 | CLANG_WARN_ENUM_CONVERSION = YES; 489 | CLANG_WARN_INT_CONVERSION = YES; 490 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 491 | CLANG_WARN_UNREACHABLE_CODE = YES; 492 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 493 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 494 | COPY_PHASE_STRIP = NO; 495 | CURRENT_PROJECT_VERSION = 1.0.1; 496 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 497 | ENABLE_NS_ASSERTIONS = NO; 498 | ENABLE_STRICT_OBJC_MSGSEND = YES; 499 | GCC_C_LANGUAGE_STANDARD = gnu99; 500 | GCC_NO_COMMON_BLOCKS = YES; 501 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 502 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 503 | GCC_WARN_UNDECLARED_SELECTOR = YES; 504 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 505 | GCC_WARN_UNUSED_FUNCTION = YES; 506 | GCC_WARN_UNUSED_VARIABLE = YES; 507 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 508 | MTL_ENABLE_DEBUG_INFO = NO; 509 | SDKROOT = iphoneos; 510 | TARGETED_DEVICE_FAMILY = "1,2"; 511 | VALIDATE_PRODUCT = YES; 512 | VERSIONING_SYSTEM = "apple-generic"; 513 | VERSION_INFO_PREFIX = ""; 514 | }; 515 | name = Release; 516 | }; 517 | D572CD7D1C5E2F400082D870 /* Debug */ = { 518 | isa = XCBuildConfiguration; 519 | buildSettings = { 520 | CLANG_ENABLE_MODULES = YES; 521 | DEFINES_MODULE = YES; 522 | DYLIB_COMPATIBILITY_VERSION = 1.0.0; 523 | DYLIB_CURRENT_VERSION = 1.0.1; 524 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 525 | INFOPLIST_FILE = ARDeepLinkButton/Info.plist; 526 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 527 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 528 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButton; 529 | PRODUCT_NAME = "$(TARGET_NAME)"; 530 | SKIP_INSTALL = YES; 531 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 532 | }; 533 | name = Debug; 534 | }; 535 | D572CD7E1C5E2F400082D870 /* Release */ = { 536 | isa = XCBuildConfiguration; 537 | buildSettings = { 538 | CLANG_ENABLE_MODULES = YES; 539 | DEFINES_MODULE = YES; 540 | DYLIB_COMPATIBILITY_VERSION = 1.0.0; 541 | DYLIB_CURRENT_VERSION = 1.0.1; 542 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 543 | INFOPLIST_FILE = ARDeepLinkButton/Info.plist; 544 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 545 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 546 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButton; 547 | PRODUCT_NAME = "$(TARGET_NAME)"; 548 | SKIP_INSTALL = YES; 549 | }; 550 | name = Release; 551 | }; 552 | D572CD801C5E2F400082D870 /* Debug */ = { 553 | isa = XCBuildConfiguration; 554 | buildSettings = { 555 | INFOPLIST_FILE = ARDeepLinkButtonTests/Info.plist; 556 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 557 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButtonTests; 558 | PRODUCT_NAME = "$(TARGET_NAME)"; 559 | }; 560 | name = Debug; 561 | }; 562 | D572CD811C5E2F400082D870 /* Release */ = { 563 | isa = XCBuildConfiguration; 564 | buildSettings = { 565 | INFOPLIST_FILE = ARDeepLinkButtonTests/Info.plist; 566 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 567 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButtonTests; 568 | PRODUCT_NAME = "$(TARGET_NAME)"; 569 | }; 570 | name = Release; 571 | }; 572 | D572CDB11C5E30450082D870 /* Debug */ = { 573 | isa = XCBuildConfiguration; 574 | buildSettings = { 575 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 576 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 577 | INFOPLIST_FILE = ARDeepLinkButtonExample/Info.plist; 578 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 579 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButtonExample; 580 | PRODUCT_NAME = "$(TARGET_NAME)"; 581 | }; 582 | name = Debug; 583 | }; 584 | D572CDB21C5E30450082D870 /* Release */ = { 585 | isa = XCBuildConfiguration; 586 | buildSettings = { 587 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 588 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 589 | INFOPLIST_FILE = ARDeepLinkButtonExample/Info.plist; 590 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 591 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButtonExample; 592 | PRODUCT_NAME = "$(TARGET_NAME)"; 593 | }; 594 | name = Release; 595 | }; 596 | D572CDB71C5E30450082D870 /* Debug */ = { 597 | isa = XCBuildConfiguration; 598 | buildSettings = { 599 | INFOPLIST_FILE = ARDeepLinkButtonExampleUITests/Info.plist; 600 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 601 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButtonExampleUITests; 602 | PRODUCT_NAME = "$(TARGET_NAME)"; 603 | TEST_TARGET_NAME = ARDeepLinkButtonExample; 604 | USES_XCTRUNNER = YES; 605 | }; 606 | name = Debug; 607 | }; 608 | D572CDB81C5E30450082D870 /* Release */ = { 609 | isa = XCBuildConfiguration; 610 | buildSettings = { 611 | INFOPLIST_FILE = ARDeepLinkButtonExampleUITests/Info.plist; 612 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 613 | PRODUCT_BUNDLE_IDENTIFIER = com.alexruperez.ARDeepLinkButtonExampleUITests; 614 | PRODUCT_NAME = "$(TARGET_NAME)"; 615 | TEST_TARGET_NAME = ARDeepLinkButtonExample; 616 | USES_XCTRUNNER = YES; 617 | }; 618 | name = Release; 619 | }; 620 | /* End XCBuildConfiguration section */ 621 | 622 | /* Begin XCConfigurationList section */ 623 | D572CD621C5E2F400082D870 /* Build configuration list for PBXProject "ARDeepLinkButton" */ = { 624 | isa = XCConfigurationList; 625 | buildConfigurations = ( 626 | D572CD7A1C5E2F400082D870 /* Debug */, 627 | D572CD7B1C5E2F400082D870 /* Release */, 628 | ); 629 | defaultConfigurationIsVisible = 0; 630 | defaultConfigurationName = Release; 631 | }; 632 | D572CD7C1C5E2F400082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButton" */ = { 633 | isa = XCConfigurationList; 634 | buildConfigurations = ( 635 | D572CD7D1C5E2F400082D870 /* Debug */, 636 | D572CD7E1C5E2F400082D870 /* Release */, 637 | ); 638 | defaultConfigurationIsVisible = 0; 639 | defaultConfigurationName = Release; 640 | }; 641 | D572CD7F1C5E2F400082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButtonTests" */ = { 642 | isa = XCConfigurationList; 643 | buildConfigurations = ( 644 | D572CD801C5E2F400082D870 /* Debug */, 645 | D572CD811C5E2F400082D870 /* Release */, 646 | ); 647 | defaultConfigurationIsVisible = 0; 648 | defaultConfigurationName = Release; 649 | }; 650 | D572CDB01C5E30450082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButtonExample" */ = { 651 | isa = XCConfigurationList; 652 | buildConfigurations = ( 653 | D572CDB11C5E30450082D870 /* Debug */, 654 | D572CDB21C5E30450082D870 /* Release */, 655 | ); 656 | defaultConfigurationIsVisible = 0; 657 | defaultConfigurationName = Release; 658 | }; 659 | D572CDB61C5E30450082D870 /* Build configuration list for PBXNativeTarget "ARDeepLinkButtonExampleUITests" */ = { 660 | isa = XCConfigurationList; 661 | buildConfigurations = ( 662 | D572CDB71C5E30450082D870 /* Debug */, 663 | D572CDB81C5E30450082D870 /* Release */, 664 | ); 665 | defaultConfigurationIsVisible = 0; 666 | defaultConfigurationName = Release; 667 | }; 668 | /* End XCConfigurationList section */ 669 | }; 670 | rootObject = D572CD5F1C5E2F400082D870 /* Project object */; 671 | } 672 | -------------------------------------------------------------------------------- /ARDeepLinkButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ARDeepLinkButton.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 12 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ARDeepLinkButton.xcodeproj/xcshareddata/xcschemes/ARDeepLinkButton.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /ARDeepLinkButton.xcodeproj/xcshareddata/xcschemes/ARDeepLinkButtonExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 67 | 73 | 74 | 75 | 76 | 77 | 78 | 84 | 86 | 92 | 93 | 94 | 95 | 97 | 98 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /ARDeepLinkButton/ARDeepLinkButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // ARDeepLinkButton.h 3 | // ARDeepLinkButton 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | //! Project version number for ARDeepLinkButton. 12 | FOUNDATION_EXPORT double ARDeepLinkButtonVersionNumber; 13 | 14 | //! Project version string for ARDeepLinkButton. 15 | FOUNDATION_EXPORT const unsigned char ARDeepLinkButtonVersionString[]; 16 | -------------------------------------------------------------------------------- /ARDeepLinkButton/ARDeepLinkButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARDeepLinkButton.swift 3 | // ARDeepLinkButton 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - ARDeepLinkButton 12 | 13 | /** 14 | UIButton subclass that handle deep links, shows in-app SKStoreProductViewController or redirects to the AppStore. 15 | */ 16 | @IBDesignable 17 | public class ARDeepLinkButton: UIButton { 18 | 19 | // MARK: - Properties 20 | 21 | /// Example: "madbike://". 22 | @IBInspectable public var deepLink: String? 23 | 24 | /// Example: "https://itunes.apple.com/us/app/madbike/id1067596651?mt=8". 25 | @IBInspectable public var iTunesURL: String? { 26 | didSet { 27 | if let iTunesURL = self.iTunesURL { 28 | do { 29 | let regex = try NSRegularExpression(pattern: "(\\d+)", options: []) 30 | let range = regex.rangeOfFirstMatchInString(iTunesURL, options: [], range: NSMakeRange(0, iTunesURL.characters.count)) 31 | let iTunesURLString: NSString = iTunesURL 32 | self.appStoreId = iTunesURLString.substringWithRange(range) 33 | } catch let error as NSError { 34 | print("\(error.localizedDescription)") 35 | self.appStoreId = nil 36 | } 37 | } 38 | } 39 | } 40 | 41 | /// Corner radius. 42 | @IBInspectable public var cornerRadius: CGFloat { 43 | set { 44 | layer.masksToBounds = true 45 | layer.cornerRadius = newValue 46 | } 47 | get { 48 | return layer.cornerRadius 49 | } 50 | } 51 | 52 | /// Border width. 53 | @IBInspectable public var borderWidth: CGFloat { 54 | set { 55 | layer.borderWidth = newValue 56 | } 57 | get { 58 | return layer.borderWidth 59 | } 60 | } 61 | 62 | /// Border color. 63 | @IBInspectable public var borderColor: UIColor? { 64 | set { 65 | layer.borderColor = newValue?.CGColor 66 | } 67 | get { 68 | return layer.borderColor != nil ? UIColor(CGColor: layer.borderColor!) : nil 69 | } 70 | } 71 | 72 | /// Image UIViewContentMode value. Example: 1 for .ScaleAspectFit. 73 | @IBInspectable public var imageContentMode: Int { 74 | set { 75 | if let imageView = imageView { 76 | if let contentMode = UIViewContentMode(rawValue: newValue) { 77 | contentVerticalAlignment = .Fill 78 | contentHorizontalAlignment = .Fill 79 | imageView.contentMode = contentMode 80 | } 81 | } 82 | } 83 | get { 84 | return imageView != nil ? imageView!.contentMode.rawValue : UIViewContentMode.ScaleToFill.rawValue 85 | } 86 | } 87 | 88 | /// Image corner radius. 89 | @IBInspectable public var imageCornerRadius: CGFloat { 90 | set { 91 | if let imageView = imageView { 92 | imageView.layer.cornerRadius = newValue 93 | } 94 | } 95 | get { 96 | return imageView != nil ? imageView!.layer.cornerRadius : 0 97 | } 98 | } 99 | 100 | /** 101 | Deep link handler, here you have access to SKStoreProductViewController in order to customize it. 102 | */ 103 | public lazy var deepLinkHandler = ARDeepLinkHandler() 104 | 105 | /// Automatically generated when iTunesURL is setted. 106 | public private(set) var appStoreId: String? 107 | 108 | // MARK: - Initializers 109 | 110 | required public init?(coder aDecoder: NSCoder) { 111 | super.init(coder: aDecoder) 112 | self.addTarget(self, action: "touchUpInsideAction:", forControlEvents: .TouchUpInside) 113 | } 114 | 115 | override public init(frame: CGRect) { 116 | super.init(frame: frame) 117 | self.addTarget(self, action: "touchUpInsideAction:", forControlEvents: .TouchUpInside) 118 | } 119 | 120 | /** 121 | Initializes and returns a newly allocated ARDeepLinkButton with the specified deepLink and iTunesURL. 122 | 123 | - parameter deepLink: Example: "madbike://". 124 | - parameter iTunesURL: Example: "https://itunes.apple.com/us/app/madbike/id1067596651?mt=8". 125 | 126 | - returns: An initialized ARDeepLinkButton or nil if the object couldn't be created. 127 | */ 128 | convenience public init(deepLink: String?, iTunesURL: String?) { 129 | self.init(frame: CGRectZero) 130 | self.initialize(deepLink, iTunesURL: iTunesURL) 131 | } 132 | 133 | // MARK: - Private methods 134 | 135 | /** 136 | Configures the ARDeepLinkButton with the specified deepLink and iTunesURL. 137 | 138 | - parameter deepLink: Example: "madbike://". 139 | - parameter iTunesURL: Example: "https://itunes.apple.com/us/app/madbike/id1067596651?mt=8". 140 | */ 141 | private func initialize(deepLink: String?, iTunesURL: String?) { 142 | self.deepLink = deepLink 143 | self.iTunesURL = iTunesURL 144 | } 145 | 146 | // MARK: - @IBActions 147 | 148 | /** 149 | Handles the ARDeepLinkButton .TouchUpInside @IBAction. 150 | 151 | - parameter sender: @IBAction sender. 152 | */ 153 | @IBAction public func touchUpInsideAction(sender: UIButton) { 154 | self.deepLinkHandler.handle(self.deepLink, appStoreId: self.appStoreId, iTunesURLString: self.iTunesURL) 155 | } 156 | 157 | } 158 | -------------------------------------------------------------------------------- /ARDeepLinkButton/ARDeepLinkHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARDeepLinkHandler.swift 3 | // ARDeepLinkButton 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import StoreKit 11 | 12 | // MARK: - ARDeepLinkHandler 13 | 14 | public class ARDeepLinkHandler: NSObject, SKStoreProductViewControllerDelegate { 15 | 16 | // MARK: - Properties 17 | 18 | /// Current SKStoreProductViewController. 19 | public var storeProductViewController: SKStoreProductViewController? 20 | 21 | /// Current UIApplication. 22 | private var application: UIApplication { 23 | return UIApplication.sharedApplication() 24 | } 25 | 26 | /// Current presented UIViewController. 27 | private var presentedViewController: UIViewController? { 28 | var viewController = self.application.keyWindow?.rootViewController 29 | while (viewController?.presentedViewController != nil) { 30 | viewController = viewController?.presentedViewController 31 | } 32 | return viewController 33 | } 34 | 35 | // MARK: - Public methods 36 | 37 | /** 38 | Open the deepLink if can, else present SKStoreProductViewController configured with passed appStoreId if can, else opens passed iTunesURLString if can. 39 | 40 | - parameter deepLink: DeepLink to be opened. 41 | - parameter appStoreId: AppStoreID to configure SKStoreProductViewController. 42 | - parameter iTunesURLString: URL to be opened if SKStoreProductViewController fails. 43 | 44 | - returns: The open result. 45 | */ 46 | public func handle(deepLink: String?, appStoreId: String?, iTunesURLString: String?) -> Bool { 47 | return self.handle(deepLink) || self.handle(appStoreId, iTunesURLString: iTunesURLString) || self.handle(iTunesURLString) 48 | } 49 | 50 | /** 51 | Present SKStoreProductViewController configured with passed appStoreId if can, else opens passed iTunesURLString if can. 52 | 53 | - parameter appStoreId: AppStoreID to configure SKStoreProductViewController. 54 | - parameter iTunesURLString: URL to be opened if SKStoreProductViewController fails. 55 | 56 | - returns: The open result. 57 | */ 58 | public func handle(appStoreId: String?, iTunesURLString: String?) -> Bool { 59 | if let appStoreId = appStoreId { 60 | if let appStoreIdUIntValue = UInt(appStoreId) { 61 | self.storeProductViewController = SKStoreProductViewController() 62 | self.storeProductViewController!.delegate = self 63 | self.storeProductViewController!.loadProductWithParameters([SKStoreProductParameterITunesItemIdentifier: NSNumber(unsignedInteger: appStoreIdUIntValue)], completionBlock: { (result: Bool, error: NSError?) -> Void in 64 | if result == false || error != nil { 65 | self.handle(iTunesURLString) 66 | } 67 | self.storeProductViewController = nil 68 | }) 69 | self.presentedViewController?.presentViewController(self.storeProductViewController!, animated: true, completion: nil) 70 | return true 71 | } 72 | } 73 | return false 74 | } 75 | 76 | /** 77 | Opens passed URLString if can. 78 | 79 | - parameter URLString: URL to be opened. 80 | 81 | - returns: The open result. 82 | */ 83 | public func handle(URLString: String?) -> Bool { 84 | if let URLString = URLString { 85 | if let URL = NSURL(string: URLString) { 86 | if self.application.canOpenURL(URL) { 87 | return self.application.openURL(URL) 88 | } 89 | } 90 | } 91 | return false 92 | } 93 | 94 | // MARK: - SKStoreProductViewControllerDelegate 95 | 96 | public func productViewControllerDidFinish(viewController: SKStoreProductViewController) { 97 | viewController.dismissViewControllerAnimated(true, completion: nil) 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /ARDeepLinkButton/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | ARDeepLinkButton 25 | 26 | 27 | -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ARDeepLinkButtonExample 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. 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: [NSObject: AnyObject]?) -> Bool { 18 | return true 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/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 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/Assets.xcassets/MADBikeIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Icon-60@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "Icon-60@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/Assets.xcassets/MADBikeIcon.imageset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexruperez/ARDeepLinkButton/8de67f494c8c38d029058f11e6d546da97a56a17/ARDeepLinkButtonExample/Assets.xcassets/MADBikeIcon.imageset/Icon-60@2x.png -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/Assets.xcassets/MADBikeIcon.imageset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexruperez/ARDeepLinkButton/8de67f494c8c38d029058f11e6d546da97a56a17/ARDeepLinkButtonExample/Assets.xcassets/MADBikeIcon.imageset/Icon-60@3x.png -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/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 | -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSApplicationQueriesSchemes 6 | 7 | madbike 8 | 9 | CFBundleDevelopmentRegion 10 | en 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | LSRequiresIPhoneOS 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ARDeepLinkButtonExample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ARDeepLinkButtonExample 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController {} 12 | 13 | -------------------------------------------------------------------------------- /ARDeepLinkButtonExampleUITests/ARDeepLinkButtonExampleUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARDeepLinkButtonExampleUITests.swift 3 | // ARDeepLinkButtonExampleUITests 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class ARDeepLinkButtonExampleUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | continueAfterFailure = false 16 | XCUIApplication().launch() 17 | } 18 | 19 | override func tearDown() { 20 | super.tearDown() 21 | } 22 | 23 | func testDeepLinkButtonTap() { 24 | XCUIApplication().buttons["MADBikeIcon"].tap() 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ARDeepLinkButtonExampleUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ARDeepLinkButtonTests/ARDeepLinkButtonTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARDeepLinkButtonTests.swift 3 | // ARDeepLinkButtonTests 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import ARDeepLinkButton 11 | 12 | class ARDeepLinkButtonTests: XCTestCase { 13 | 14 | var deepLinkButton: ARDeepLinkButton? 15 | 16 | override func setUp() { 17 | super.setUp() 18 | 19 | self.deepLinkButton = ARDeepLinkButton() 20 | } 21 | 22 | override func tearDown() { 23 | self.deepLinkButton = nil 24 | 25 | super.tearDown() 26 | } 27 | 28 | func testAppStoreId() { 29 | self.deepLinkButton?.iTunesURL = "https://itunes.apple.com/us/app/madbike/id1067596651?mt=8" 30 | XCTAssert(self.deepLinkButton?.appStoreId == "1067596651", "appStoreId generated incorrectly") 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ARDeepLinkButtonTests/ARDeepLinkHandlerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARDeepLinkHandlerTests.swift 3 | // ARDeepLinkButton 4 | // 5 | // Created by alexruperez on 31/1/16. 6 | // Copyright © 2016 alexruperez. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import ARDeepLinkButton 11 | 12 | class ARDeepLinkHandlerTests: XCTestCase { 13 | 14 | var deepLinkHandler: ARDeepLinkHandler? 15 | 16 | override func setUp() { 17 | super.setUp() 18 | 19 | self.deepLinkHandler = ARDeepLinkHandler() 20 | } 21 | 22 | override func tearDown() { 23 | self.deepLinkHandler = nil 24 | 25 | super.tearDown() 26 | } 27 | 28 | func testStoreProductViewController() { 29 | self.deepLinkHandler?.handle(nil, appStoreId: "1067596651", iTunesURLString: nil) 30 | XCTAssert(self.deepLinkHandler?.storeProductViewController != nil, "storeProductViewController doesn't exist") 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ARDeepLinkButtonTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexruperez/ARDeepLinkButton/8de67f494c8c38d029058f11e6d546da97a56a17/CHANGELOG.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexruperez/ARDeepLinkButton/8de67f494c8c38d029058f11e6d546da97a56a17/CONTRIBUTING.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 alexruperez 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | name: "ARDeepLinkButton" 5 | origin: "com.alexruperez" 6 | ) 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ARDeepLinkButton 2 | 3 | [![Join the chat at https://gitter.im/alexruperez/ARDeepLinkButton](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/alexruperez/ARDeepLinkButton?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 4 | [![Twitter](http://img.shields.io/badge/contact-@alexruperez-blue.svg?style=flat)](http://twitter.com/alexruperez) 5 | [![CI Status](http://img.shields.io/travis/alexruperez/ARDeepLinkButton.svg?style=flat)](https://travis-ci.org/alexruperez/ARDeepLinkButton) 6 | [![Version](https://img.shields.io/cocoapods/v/ARDeepLinkButton.svg?style=flat)](http://cocoadocs.org/docsets/ARDeepLinkButton) 7 | [![License](https://img.shields.io/cocoapods/l/ARDeepLinkButton.svg?style=flat)](http://cocoadocs.org/docsets/ARDeepLinkButton) 8 | [![Platform](https://img.shields.io/cocoapods/p/ARDeepLinkButton.svg?style=flat)](http://cocoadocs.org/docsets/ARDeepLinkButton) 9 | [![Codebeat](https://codebeat.co/badges/1813a7ef-cd6e-4f3a-954f-2bf674a956f8)](https://codebeat.co/projects/github-com-alexruperez-ardeeplinkbutton) 10 | [![Analytics](https://ga-beacon.appspot.com/UA-55329295-1/ARDeepLinkButton/readme?pixel)](https://github.com/igrigorik/ga-beacon) 11 | 12 | ## Overview 13 | 14 | `ARDeepLinkButton` is an `UIButton` subclass that handle deep links, shows in-app `SKStoreProductViewController` or redirects to the AppStore. Written in Swift 2.1.1 15 | 16 | ![ARDeepLinkButton Screenshot](https://raw.githubusercontent.com/alexruperez/ARDeepLinkButton/master/screenshot.png) 17 | 18 | ### Installation 19 | 20 | `ARDeepLinkButton` is available through [CocoaPods](http://cocoapods.org). To install 21 | it, simply add the following line to your `Podfile`: 22 | 23 | pod "ARDeepLinkButton" 24 | 25 | #### Or you can install it with [Swift Package Manager](https://github.com/apple/swift-package-manager): 26 | 27 | .Package(url: "ssh://git@github.com:alexruperez/ARDeepLinkButton.git", versions: Version(1,0,0).. Bool 57 | public func handle(appStoreId: String?, iTunesURLString: String?) -> Bool 58 | public func handle(URLString: String?) -> Bool 59 | ``` 60 | 61 | #### iOS 9 Reminder 62 | 63 | Add your deep link to `LSApplicationQueriesSchemes` in your `Info.plist` 64 | 65 | ```plist 66 | LSApplicationQueriesSchemes 67 | 68 | madbike 69 | 70 | ``` 71 | 72 | # Etc. 73 | 74 | * Contributions are very welcome. 75 | * Attribution is appreciated (let's spread the word!), but not mandatory. 76 | 77 | ## Use it? Love/hate it? 78 | 79 | Tweet the author [@alexruperez](http://twitter.com/alexruperez), and check out alexruperez's blog: http://alexruperez.com 80 | 81 | ## License 82 | 83 | ARDeepLinkButton is available under the MIT license. See the LICENSE file for more info. 84 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexruperez/ARDeepLinkButton/8de67f494c8c38d029058f11e6d546da97a56a17/screenshot.png --------------------------------------------------------------------------------