Giter Site home page Giter Site logo

swift4u / kyshutterbutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ykyouhei/kyshutterbutton

0.0 2.0 0.0 152 KB

KYShutterButton is a custom button that is similar to the shutter button of the camera app

License: MIT License

Swift 96.40% Ruby 3.60%

kyshutterbutton's Introduction

KYShutterButton

Pod Version Pod Platform Pod License Language

KYShutterButton is a custom button that is similar to the shutter button of the camera app

  • IBDesignable, IBInspectable Support

sample1.gif sample2.gif

Installation

CocoaPods

KYShutterButton is available on CocoaPods. Add the following to your Podfile:

pod 'KYShutterButton'

Manually

Just add the Classes folder to your project.

Usage

(see sample Xcode project in /Example)

Code

let shutterButton = KYShutterButton(
	frame: CGRectMake(20, 20, 100, 100),
    shutterType: .Normal,
    buttonColor: UIColor.redColor()
)
shutterButton.addTarget(self,
    action: "didTapButton:",
    forControlEvents: .TouchUpInside
)
/* Custom
shutterButton.arcColor      = UIColor.greenColor()
shutterButton.progressColor = UIColor.yellowColor()
*/
view.addSubview(shutterButton)


func didTapButton(sender: KYShutterButton) {
    switch sender.buttonState {
    case .Normal:
        sender.buttonState = .Recording
    case .Recording:
        sender.buttonState = .Normal
    }
}

Storyboard

sample3.gif

License

This code is distributed under the terms and conditions of the MIT license.

kyshutterbutton's People

Contributors

ykyouhei avatar

Watchers

James Cloos avatar GRaj 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.