iOS 动画提交按钮组件 SubmitButton

码农软件 · 软件分类 · 按钮(Button) · 2019-05-22 13:58:29

软件介绍

SubmitButton 是一组iOS 动画提交按钮,采用Swift开发。

效果图:


使用环境:

  • swift2 +

  • xcode7.3 +

使用:

1 创建一个按钮

  • using code

        let frame = CGRect(x: 50, y: 100, width: 200, height: 60)
        button = SubmitButton(frame: frame)
        button.setTitle("Submit", forState: .Normal)        
        self.view.addSubview(button)
  • using Storyboard or XIB

previewpreview

2  (Optional) 按钮属性设置

   btn.checkLineWidth = 6.0
   btn.progressBorderWidth  = 5.0
   btn.successColor = UIColor(red:0, green:206/255, blue:148/255, alpha:1)
   btn.progressColor = UIColor(red:0, green:206/255, blue:148/255, alpha:1)

3 (Optional) 按钮statechanged回调

  btn1.stateChanged = {
            (toState:SubmitButtonState) in
            if toState == .Loading {                self.btn1.progress  = 1
            }
  }

4 改变按钮状态

@IBAction func btnClicked(sender: AnyObject) {        let btn = sender as! SubmitButton        if btn.submitState != .Normal  {
            btn.changeState(.Normal)

        } else {
            btn.changeState(.Loading)
        }
    }

5 设置进度

  ...
   btn.progress = 1
  ...

本文地址:https://www.codercto.com/soft/d/6300.html

Cracking the Coding Interview

Cracking the Coding Interview

Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95

Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具