Latest 1.0.5
Homepage https://github.com/BecomerichAsun/AsunAnimationSwitch
License MIT
Platforms ios 8.0
Authors

AsunAnimationSwitch-Swift

License MIT Support

Features

Support Click animation derived from native animation

You can import this framework using cocoapods

pod ‘AsunAnimationSwitch’,’~> 1.0.5′

The effect

imag

Usage

  let asun = AsunAnimationSwitch(frame: CGRect(x: 100, y: 100, width: 50, height: 50))
        asun.Basic.setDuration(value: 0.5)
        asun.Basic.setEndValue(value: 0.8)
        asun.Basic.setStartValue(value: 0.3)
        asun.Basic.setLineWidth(value: 4)
        asun.Basic.setAddValue(value: 0)
        asun.Basic.setStrokeColor(color: UIColor.blue)
        asun.Basic.setTrailColor(color: UIColor.red)
        view.addSubview(asun)
        asun.setSelected(isSelected: !asun.isSelected, animated: true)

Basic

 /**  线宽  **/
    var lineWidth: CGFloat {get set}
    /**  动画结束位置  **/
    var finalStrokeEndForCheckmark: CGFloat {get set}
    /**  动画开始位置  **/
    var finalStrokeStartForCheckmark: CGFloat {get set}
    /**  动画增加距离  **/
    var checkmarkBounceAmount: CGFloat {get set}
    /**  动画持续时间  **/
    var animationDuration: CFTimeInterval {get set}
    /**  默认以及动画结束后标记的颜色  **/
    var strokeColor: UIColor {get set}
    /** 动画结束后的圆圈颜色  **/
    var trailStrokeColor: UIColor {get set}

ChangeBasic

    mutating func setEndValue(value:CGFloat)
    mutating func setStartValue(value:CGFloat)
    mutating func setAddValue(value:CGFloat)
    mutating func setDuration(value:CGFloat)
    mutating func setLineWidth(value:CGFloat)
    mutating func setStrokeColor(color:UIColor)
    mutating func setTrailColor(color:UIColor)

Install

CocoaPods

Add pod ‘AsunAnimationSwitch’ in Podfile

System Requirements

iOS 8.0

Latest podspec

{
    "name": "AsunAnimationSwitch",
    "version": "1.0.5",
    "summary": "u70b9u51fbSwitchu663eu793au6b63u786eu52a8u753bSwift4.0u7248u672c",
    "description": "u70b9u51fbSwitchu52a8u753bSwiftu7248u672c,u8be6u60c5u770bu4e3bu9875~",
    "homepage": "https://github.com/BecomerichAsun/AsunAnimationSwitch",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Asun": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.0",
    "source": {
        "git": "https://github.com/BecomerichAsun/AsunAnimationSwitch.git",
        "tag": "1.0.5"
    },
    "source_files": "*.swift"
}

Pin It on Pinterest

Share This