Latest 3.0.0
Homepage https://github.com/leetal/KYShutterButton
License MIT
Platforms ios 8.0, requires ARC
Authors ,

KYShutterButton

Carthage compatible
Pod Version
Pod Platform
Pod License
Swift version

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.

Latest podspec

{
    "name": "leetal-KYShutterButton",
    "version": "3.0.0",
    "summary": "KYShutterButton is a custom button that is similar to the shutter button of the camera app",
    "homepage": "https://github.com/leetal/KYShutterButton",
    "license": "MIT",
    "authors": {
        "Kyohei Yamaguchi": "[email protected]",
        "leetal": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/leetal/KYShutterButton.git",
        "tag": "3.0.0"
    },
    "source_files": "KYShutterButton/Classes/*.swift",
    "requires_arc": true
}

Pin It on Pinterest

Share This