文章来源:淘论文网   发布者: 毕业设计   浏览量: 34



还可以点击去查询以下关键词:
[swift3.0]    [装的]    [毕业]    [动画]    [效果]    [开关]    [swift3.0 封装的毕业动画效果开关]   

项目介绍:

用swift3 封装的带有动画效果的开关,支持storyboard进行设置,开题报告开题报告,可以通过代理获取相应的状态。
Demo地址:https://github.com/kiddhmh/MHSwitch ,有详细的集成和使用说明,欢迎大家下载使用,别忘了给个star哦~~

MHSwitch动画效果的开关;

This is a funny switch for iOS

Thank lilei644 for providing inspiration

Preview 预览

Installation  

Common

Add 'MHSwitch' files to your Project   // 直接导入“MHSwitch”文件夹到项目中 (后面会支持cocoaPod和carthge导入)Usage  用法

Init  初始化

let mhSwitch = MHSwitch.init(frame: CGRect(x: 100, y: 100, width: 120, height: 60)) view.addSubview(mhSwitch)

Reset Base Property  重设基本属性

mhSwitch.onColor = .blue   // switch is open color   开关打开的颜色 mhSwitch.offColor = .gray   // switch is close color   开关关闭的颜色 mhSwitch.faceColor = .whiteColor   // switch face color   圆脸的颜色 mhSwitch.animationDuration = 1.2 // switch open or close animation time 开关的动画时间 mhSwitch.isOn = true                     // set on and off     设置开关 mhSwitch.setOn(isOn: true, animated: true)

delegate  代理监听

mhSwitch.delegate = self func valueDidChanged(mhSwitch: MHSwitch, isOn: Bool) { print('stop\(isOn)') } func didTapMHSwitch(mhSwitch: MHSwitch) { print('didStart') } func animationDidStopForMHSwitch(mhSwitch: MHSwitch) { print('didStop') }

support xib and storyboard 支持xib和storyboard


这里还有:


还可以点击去查询:
[swift3.0]    [装的]    [毕业]    [动画]    [效果]    [开关]    [swift3.0 封装的毕业动画效果开关]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/7741.docx
  • 上一篇:iOS定位及航向功能 - LocationManager
  • 下一篇:视图点赞工具毕业设计 - MDCSwipeToChoose