https://github.com/ww-tech/wwlayout
Swifty DSL for programmatic Auto Layout in iOS
https://github.com/ww-tech/wwlayout
auto-layout auto-layout-code auto-layout-programmatically autolayout autolayout-constraints autolayout-framework constraints ios layout swift
Last synced: 8 months ago
JSON representation
Swifty DSL for programmatic Auto Layout in iOS
- Host: GitHub
- URL: https://github.com/ww-tech/wwlayout
- Owner: ww-tech
- License: apache-2.0
- Created: 2018-12-03T18:09:11.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-06-01T11:01:52.000Z (over 2 years ago)
- Last Synced: 2024-10-14T22:21:30.323Z (about 1 year ago)
- Topics: auto-layout, auto-layout-code, auto-layout-programmatically, autolayout, autolayout-constraints, autolayout-framework, constraints, ios, layout, swift
- Language: Swift
- Homepage: https://ww-tech.github.io/wwlayout/
- Size: 631 KB
- Stars: 52
- Watchers: 4
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing-guidelines.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
WWLayout
Easy to write auto layout constraints, with minimal extensions to standard namespaces.
## Feature Highlights
* Easy to use, readable API
* Backwards-compatible (i.e. pre iOS 11) Safe Area constraints
* Tag constraints to easily switch between different layouts (coming soon)
* Automatic switching of size-class based constraints (coming soon)
## Introduction
Constraints are added to a view using the view's `layout` property, like so:
```swift
myView.layout.width(400)
```
Multiple constraints are easily added by chaining calls:
```swift
myView.layout.width(400).height(200)
```
A more complicated example:
```swift
let container = UIView()
let child = UIView()
container.layout.fill(.safeArea)
child.layout
.fill(container, axis: .x, inset: 20)
.center(in: container, axis: .y, priority: .high)
.top(.lessOrEqual, to: container, offset: 100)
.height(toWidth: 0.5)
```
## Dcumentation
### [Documentation can be found here](//ww-tech.github.io/wwlayout/)
## Installation
### Swift Package Manager
The WWLayout Package URL is:
```
https://github.com/ww-tech/wwlayout.git
```
Add the package dependency to your Xcode project using the `File` -> `Swift Packages` -> `Add Package Dependency...` menu item.
### Cocoapods
Simply add WWLayout to your `Podfile`:
```
pod 'WWLayout'
```
## Contributing
## Authors
* [Steven Grosmark](https://github.com/g-mark), steven.grosmark@ww.com
* WW iOS Team
## License
WWLayout is © copyright by WW International.
WWLayout is licensed under the [Apache-2.0 Open Source license](http://choosealicense.com/licenses/apache-2.0/).