Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bionelabs/UILayoutKit
Draw view easy with visual
https://github.com/bionelabs/UILayoutKit
autolayout autolayout-constraints caophuocthanh ios layout onebuffer swift swift4 xcode
Last synced: about 5 hours ago
JSON representation
Draw view easy with visual
- Host: GitHub
- URL: https://github.com/bionelabs/UILayoutKit
- Owner: bionelabs
- License: mit
- Created: 2020-04-24T16:43:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T14:57:37.000Z (over 4 years ago)
- Last Synced: 2024-11-15T22:13:50.001Z (about 5 hours ago)
- Topics: autolayout, autolayout-constraints, caophuocthanh, ios, layout, onebuffer, swift, swift4, xcode
- Language: Swift
- Homepage: https://onebuffer.com
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UILayoutKit
Draw view easy with visual
## Intallation
### CocoaPods
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Alamofire into your Xcode project using CocoaPods, specify it in your Podfile:```swift
pod 'UISwiftLayoutKit'
```## How to use
```swift
view.visual.anchor(...)
view.visual.size(...)
view.visual.format(...)
view.visual.center(...)
view.visual.equal(...)
view.visual.stack(...)
view.visual.square(...)```
### Example 1:
```swift
self.view.visual.anchor([.top, .horizontal], for: view1, padding: 0)
self.view.visual.size([.height], for: view1, constant: 80)
self.view.visual.anchor([.bottom, .horizontal], for: view2, padding: 0)
self.view.visual.size([.height], for: view2, constant: 50)
self.view.visual.anchor([.horizontal, .vertical], for: view0, padding: 100)
```### Example 2:
```swift
self.view.visual.format("H:|-0-[v0]-0-[v1]-0-[v2]-0-|", for: [view0, view1, view2])
self.view.visual.anchor([.vertical], for: view0, padding: 0)
self.view.visual.anchor([.vertical], for: view1, padding: 0)
self.view.visual.anchor([.vertical], for: view2, padding: 0)
self.view.visual.equal(.width, views: [view0, view1, view2])
```### Example 3:
```swift
self.view.visual.stack(.horizontal, for: [view0, view1, view2], spacing: 16)
self.view.visual.anchor([.vertical], for: view0, padding: 0)
self.view.visual.anchor([.vertical], for: view1, padding: 0)
self.view.visual.anchor([.vertical], for: view2, padding: 0)
self.view.visual.equal(.width, views: [view0, view1, view2])
```### Example 4:
```swift
self.view.visual.stack(.vertical, for: [view0, view1, view2], spacing: 0)
self.view.visual.anchor([.horizontal], for: view0, padding: 0)
self.view.visual.anchor([.horizontal], for: view1, padding: 0)
self.view.visual.anchor([.horizontal], for: view2, padding: 0)
self.view.visual.equal(.height, views: [view0, view1, view2])
```### Example 5:
```swift
self.view.visual.stack(.vertical, for: [view0, view1, view2], spacing: 0)
self.view.visual.anchor([.horizontal], for: view0, padding: 0)
self.view.visual.anchor([.horizontal], for: view1, padding: 0)
self.view.visual.anchor([.horizontal], for: view2, padding: 0)
self.view.visual.size([.width], for: view0, constant: 64)
self.view.visual.size([.width], for: view2, constant: 50)
```## Contact
- Email: [email protected]
- Site: https://onebuffer.com
- Linkedin: https://www.linkedin.com/in/caophuocthanh/