pod 'AsunAnimationSwitch','~> 1.0.5'
let sss = AsunAnimationSwitch(frame: CGRect(x: 100, y: 100, width: 50, height: 50)) sss.Basic.setDuration(value: 0.8) sss.Basic.setTrailColor(color: UIColor.red) sss.Basic.setStrokeColor(color: UIColor.gray) sss.Basic.setLineWidth(value: 5) view.addSubview(sss) sss.setSelected(isSelected: !sss.isSelected, animated: true)