CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Nov 2017 |
| SwiftSwift Version | 3.0 |
| SPMSupports SPM | ✗ |
Maintained by Binur.
SubscriptionPrompt is a UIViewController with a carousel at the top and a number of rows at the bottom. Written in Swift, works for Objective-C as well.
/SubscriptionPromptfolder in your project.Just initialize the SubscriptionViewontroller with the following constructor, you can omit some parameters since they have default values:
init(title: String? = nil, slides: [Slide], options: [Option],
cancelMessage: String? = nil, restoreButtonTitle: String? = nil)and present it.
Slide and Option are structs, use the following inits to create them:
init(image: UIImage?, title: String?, subtitle: String?)
init(title: String?, checked: Bool = false)To get the index of tapped rows, implement the SubscriptionViewControllerDelegate.
override func viewDidLoad() {
super.viewDidLoad()
subscriptionViewController.delegate = self
}
func subscriptionViewControllerRowTapped(atIndex index: Int) {
print("tapped index: \(index)")
}animateDraggingToTheRight(duration:) - animates a little drag to the right and back with the given duration [ux hint for the user that the carousel is draggable]
subscriptionVC.rowTapped { idx in
print("tapped index: \(idx)")
}