Giter VIP home page Giter VIP logo

hokusai's Introduction

Main

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.

Version Platform CI Status Carthage compatible

Installation

Drop in the Classes folder to your Xcode project.
You can also use cocoapods or Carthage.

Using cocoapods

Add pod 'Hokusai' to your Podfile and run pod install. Also add use_frameworks! to the Podfile.

use_frameworks!
pod 'Hokusai'

Using Carthage

Add github "ytakzk/Hokusai" to your Cartfileand runcarthage update`. If unfamiliar with Carthage then checkout their Getting Started section.

github "ytakzk/Hokusai"

Demo

Demo

Hokusai Usage

Import Hokusai import Hokusai then use the following codes in some function except for viewDidLoad.

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. AvenirNext-DemiBold is the default.
hokusai.fontName = "Verdana-Bold"

// Select a color scheme. Just below you can see the dafault sets of schemes.
hokusai.colorScheme = HOKColorScheme.Enshu

// Show Hokusai
hokusai.show()

// Selector for the button 2
func button2Pressed() {
    println("Oribe")
}

Add a button with a closure

hokusai.addButton("Button Title") {
    // Do anything you want
}

Add a button with a selector

hokusai.addButton("Button Title", target: self, selector: Selector("buttonPressed"))

func buttonPressed() {
    // Do anything you want
}

Color schemes

Demo

public enum HOKColorScheme {
    case  Hokusai,
          Asagi,
          Matcha,
          Tsubaki,
          Inari,
          Karasu,
          Enshu
}

Or you can use your favorite color combination.

hokusai.colors = HOKColors(
    backGroundColor: UIColor.blackColor(),
    buttonColor: UIColor.purpleColor(),
    cancelButtonColor: UIColor.grayColor(),
    fontColor: UIColor.whiteColor()
)

Author

ytakzk
http://ytakzk.me

License

Hokusai is released under the MIT license.
See LICENSE for details.

hokusai's People

Contributors

ytakzk avatar

Watchers

Chew Chit Siang avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.