ARDeepLinkButton 1.0.1

ARDeepLinkButton 1.0.1

测试已测试
Lang语言 SwiftSwift
许可证 MIT
Released最新版本2016年2月
SPM支持 SPM

alexruperez 维护。




ARDeepLinkButton

Analytics

概述

ARDeepLinkButton 是一个处理深链接的 UIButton 子类,显示应用内的 SKStoreProductViewController 或重定向到 AppStore。使用 Swift 2.0 编写

ARDeepLinkButton Screenshot

安装

或者您可以使用 Swift Package Manager 安装它

.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

iOS 9 提示

将您深的链接添加到 LSApplicationQueriesSchemes 中的您的 Info.plist

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>madbike</string>
</array>

等等。

  • 接受各种贡献。
  • 感激认可(让我们传播这个词!),但非强制。

使用它?喜欢/讨厌它?

向作者 @alexruperez 发推文,并查看 alexruperez 的博客: http://alexruperez.com

许可证

ARDeepLinkButton 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。