测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
Released最新版本 | 2016年2月 |
SPM支持 SPM | ✓ |
由 alexruperez 维护。
ARDeepLinkButton
是一个处理深链接的 UIButton
子类,显示应用内的 SKStoreProductViewController
或重定向到 AppStore。使用 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
是 @IBDesignable
且具有以下属性
@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
可以独立使用,并且具有以下公有方法
public func handle(deepLink: String?, appStoreId: String?, iTunesURLString: String?) -> Bool
public func handle(appStoreId: String?, iTunesURLString: String?) -> Bool
public func handle(URLString: String?) -> Bool
将您深的链接添加到 LSApplicationQueriesSchemes
中的您的 Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>madbike</string>
</array>
向作者 @alexruperez 发推文,并查看 alexruperez 的博客: http://alexruperez.com
ARDeepLinkButton 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。