https://github.com/kenanatmaca/layoutconstraints
İOS Simple Autolayout Class
https://github.com/kenanatmaca/layoutconstraints
Last synced: 18 days ago
JSON representation
İOS Simple Autolayout Class
- Host: GitHub
- URL: https://github.com/kenanatmaca/layoutconstraints
- Owner: KenanAtmaca
- License: mit
- Created: 2016-10-03T21:46:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-05T14:50:13.000Z (over 9 years ago)
- Last Synced: 2025-08-17T12:36:45.334Z (10 months ago)
- Language: Swift
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LayoutConstraints
İOS Simple Autolayout Class
```Swift
redView = UIView()
redView.backgroundColor = UIColor.red
view.addSubview(redView)
greenView = UIView()
greenView.backgroundColor = UIColor.green
view.addSubview(greenView)
blueView = UIView()
blueView.backgroundColor = UIColor.blue
view.addSubview(blueView)
```
- Use Simple and Easy Programmatically Autolayout Class with Swift
```Swift
let const = LayoutConstraints(to: self.view)
const.width(item: greenView, value: 200)
const.height(item: greenView, value: 100)
const.centerX(item: greenView, toItem: self.view)
const.size(item: redView, size: CGSize(width: 100, height: 100))
const.centerX(item: redView, toItem: greenView)
const.equalBottom(item: redView, toItem: self.view)
const.bottom(item: redView, toItem: self.view, value: -40)
const.fillWidth(item: blueView, toItem: self.view)
const.height(item: blueView, value: 50)
const.centerY(item: blueView, toItem: self.view)
const.final()
```