Giter Site home page Giter Site logo

chaincontrol's Introduction

ChainControl

CI Status Version License Platform

Swift基础控件UILabel、UIButton、UITextField、 UITextView、UIImageView、UIView链式写法,简化代码

利用链式编程方法使基础控件写法简易化,需要的属性向后拼接即可

安装使用

  • pods导入
pod 'ChainControl'
  • 手动导入 直接拖拽 ChainControl文件夹至你的项目

代码比对示例

  • 原生示例
let btn = UIButton(frame: CGRect(x: 10, y: 200, width: 50, height: 50))
btn.setTitle("button", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = .systemFont(ofSize: 16)
btn.backgroundColor = .blue
btn.layer.shadowColor = UIColor.gray.cgColor
btn.layer.shadowOpacity = 1
btn.layer.shadowOffset = CGSize(width: 1, height: 1)
btn.layer.shadowRadius = 2
self.view.addSubview(btn)
  • ChainControl示例
let btnExample = UIButton(frame: CGRect(x: 10, y: 100, width: 50, height: 50)).ctrl_title("button").ctrl_titleColor(.white).ctrl_font(.systemFont(ofSize: 16)).ctrl_backgroundColor(.blue).ctrl_shadow(color: .gray)
self.view.addSubview(btnExample)

chaincontrol's People

Contributors

xueyanglee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.