CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

SubscriptionPrompt 1.1.0

SubscriptionPrompt 1.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Nov 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Binur.



SubscriptionPrompt

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.

SubscriptionPrompt screenshot

Installation

Manually

  1. Download and drop /SubscriptionPromptfolder in your project.
  2. Congratulations!

Usage

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]

TODO

  1. Fonts customizations.
  2. Colors customziations.
  3. Add closure-based delegation API. Example:
subscriptionVC.rowTapped { idx in
    print("tapped index: \(idx)")
}