TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Feb 2016 |
SPMSupports SPM | ✓ |
Maintained by alexruperez.
ARDeepLinkButton
is an UIButton
subclass that handle deep links, shows in-app SKStoreProductViewController
or redirects to the AppStore. Written in Swift 2.0
.Package(url: "ssh://[email protected]:alexruperez/ARDeepLinkButton.git", versions: Version(1,0,0)..<Version(2,0,0)),
ARDeepLinkButton.swift
ARDeepLinkHandler.swift
ARDeepLinkButton
is @IBDesignable
and has the following properties:
@IBInspectable public var deepLink: String? // Example: "madbike://"
@IBInspectable public var iTunesURL: String? // Example: "https://itunes.apple.com/us/app/madbike/id1067596651?mt=8"
@IBInspectable public var cornerRadius: CGFloat // UIButton corner radius.
@IBInspectable public var borderWidth: CGFloat // UIButton border width.
@IBInspectable public var borderColor: UIColor? // UIButton border color.
@IBInspectable public var imageContentMode: Int // UIButton image UIViewContentMode value. Example: 1 for .ScaleAspectFit
@IBInspectable public var imageCornerRadius: CGFloat // UIButton image corner radius.
public lazy var deepLinkHandler = ARDeepLinkHandler() // Deep link handler, here you have access to SKStoreProductViewController in order to customize it.
public private(set) var appStoreId: String? // Automatically generated when iTunesURL is setted.
ARDeepLinkHandler
can be used independently and has the following public methods:
public func handle(deepLink: String?, appStoreId: String?, iTunesURLString: String?) -> Bool
public func handle(appStoreId: String?, iTunesURLString: String?) -> Bool
public func handle(URLString: String?) -> Bool
Add your deep link to LSApplicationQueriesSchemes
in your Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>madbike</string>
</array>
Tweet the author @alexruperez, and check out alexruperez’s blog: http://alexruperez.com
ARDeepLinkButton is available under the MIT license. See the LICENSE file for more info.