TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2017 |
SwiftSwift Version | 3.1 |
SPMSupports SPM | ✗ |
Maintained by kyo__hei.
KYShutterButton
is a custom button that is similar to the shutter button of the camera app
Just add the Classes folder to your project.
(see sample Xcode project in /Example
)
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
}
}
This code is distributed under the terms and conditions of the MIT license.