CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Dhiraj Jadhao.
Depends on: | |
Eureka | ~> 2.0.0-beta.1 |
Nuke-FLAnimatedImage-Plugin | >= 0 |
QRCode | >= 0 |
Casper is a lightweight and highly customisable framework which extends the usability of UIAlertController to provide you with much more customisable and frequently required UI elements.
You can clone and run the Example project to see examples of most of Casper’s features.
import Casper
class MyViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let casperController = UICasperController(title: "Title", message: "Message", preferredStyle: UICasperControllerStyle.alert)
casperController.addAction(title: "Volume", style: UICasperActionStyle.slider, options: nil, value: nil) { (value) in
}
casperController.present(inViewController: self, animated: true, completion: nil)
}
}
Here we created an instance of casper controller and added casper controller action to it of style Slider. You can create controller in this way and add an actions of different styles to it.
Every action comes with its handler which gets called when there is change in value.
Casper supports following styles same as UIAlertController
let casperController = UICasperController(title: "Title", message: "Message", preferredStyle: UICasperControllerStyle.alert)
let casperController = UICasperController(title: "Title", message: "Message", preferredStyle: UICasperControllerStyle.actionSheet)
Casper supports following Action Styles
Here all actions all listed with their description and with type of options they support for customisation and type of value they returns.
This adds Switch to casper.
options: nil
value: bool
This adds Label to casper.
options: nil
value: String
This adds Segment control to casper.
options: Array of string option
value: String
e.g options = [“One”, “Two”, “Three”]
This adds Check mark row to casper.
options: nil
value: Bool
This adds Slider to casper.
options: [minValue, maxValue]
value: Float
e.g options = [0, 5] where 0 is minumum value and 5 is maximum value.
This adds Stepper to casper.
options: [minValue, maxValue, stepValue]
value: Double
e.g options = [0, 5, 0.5] where 0 is minumum value and 5 is maximum value and 0.5 is the step value.
This adds TextView to casper.
options: nil
value: String
This adds TextField to casper.
options: nil
value: String
This adds URLField to casper.
options: nil
value: URL
This adds IntField to casper.
options: nil
value: Int
This adds PhoneField to casper.
options: nil
value: String
This adds PasswordField to casper.
options: nil
value: String
This adds EmailField to casper.
options: nil
value: String
This adds EmailField to casper.
options: nil
value: String
This adds Date to casper.
options: nil
value: Date