Hokusai is a Swift library that provides a bouncy action sheet.
It will give the users a fancy experience without taking pains coding the cool animation.
This is inspired by Skype's iOS app.
Drop in the Classes folder to your Xcode project.
Or via CocoaPods
use_frameworks!
pod 'Hokusai'
Import Hokusai then use the following codes in some function.
let hokusai = Hokusai()
// Add a button with a closure
hokusai.addButton("Button 1") {
println("Rikyu")
}
// Add a button with a selector
hokusai.addButton("Button 2", target: self, selector: Selector("button2Pressed"))
// Set a font name. Default is AvenirNext-DemiBold.
hokusai.fontName = "Verdana-Bold"
// Select a color scheme
hokusai.colorScheme = HOKColorScheme.Enshu
// Show Hokusai
hokusai.show()
// Selector for the button 2
func button2Pressed() {
println("Oribe")
}
hokusai.addButton("Button Title") {
// Do anything you want
}
hokusai.addButton("Button Title", target: self, selector: Selector("buttonPressed"))
func buttonPressed() {
// Do anything you want
}
public enum HOKColorScheme {
case Hokusai,
Asagi,
Matcha,
Tsubaki,
Inari,
Karasu,
Enshu
}
Or you can use your designed colors.
hokusai.colors = HOKColors(
backGroundColor: UIColor.blackColor(),
buttonColor: UIColor.purpleColor(),
cancelButtonColor: UIColor.grayColor(),
fontColor: UIColor.whiteColor()
)
ytakzk
http://ytakzk.me
Hokusai is released under the MIT license.
See LICENSE for details.