测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布上次发布 | 2017年11月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Binur 维护。
SubscriptionPrompt 是一个带有顶部旋转卡和底部多行的 UIViewController。使用 Swift 编写,也适用于 Objective-C。
/SubscriptionPrompt
文件夹拖放到您的项目中。只需使用以下构造函数初始化 SubscriptionViewController,您可以省略一些参数,因为它们有默认值
init(title: String? = nil, slides: [Slide], options: [Option],
cancelMessage: String? = nil, restoreButtonTitle: String? = nil)
然后显示它。
Slide
和 Option
是结构体,使用以下初始化来创建它们
init(image: UIImage?, title: String?, subtitle: String?)
init(title: String?, checked: Bool = false)
要获取被点击行的索引,实现 SubscriptionViewControllerDelegate。
override func viewDidLoad() {
super.viewDidLoad()
subscriptionViewController.delegate = self
}
func subscriptionViewControllerRowTapped(atIndex index: Int) {
print("tapped index: \(index)")
}
animateDraggingToTheRight(duration:)
- 使用给定的时间间隔执行一点向右的拖动再返回的动作(向用户展示旋转卡可拖动的ux提示)
subscriptionVC.rowTapped { idx in
print("tapped index: \(idx)")
}