Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daskioff/RKAutoLayout
Easy Auto Layout
https://github.com/daskioff/RKAutoLayout
autolayout autolayout-constraints ios swift
Last synced: 3 months ago
JSON representation
Easy Auto Layout
- Host: GitHub
- URL: https://github.com/daskioff/RKAutoLayout
- Owner: DaskiOFF
- License: mit
- Created: 2018-06-10T20:37:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-02T11:47:27.000Z (almost 6 years ago)
- Last Synced: 2024-04-29T17:20:33.407Z (10 months ago)
- Topics: autolayout, autolayout-constraints, ios, swift
- Language: Swift
- Size: 638 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - RKAutoLayout - Simple wrapper over AutoLayout. (Layout / Other Hardware)
- awesome-ios-star - RKAutoLayout - Simple wrapper over AutoLayout. (Layout / Other Hardware)
README
# RKAutoLayout
[](https://travis-ci.org/DaskiOFF/RKAutoLayout)
[](https://cocoapods.org/)
[](https://codecov.io/gh/daskioff/RKAutoLayout)
[](https://daskioff.github.io/RKAutoLayout/)
[](https://cocoapods.org/pods/RKAutoLayout)
[](https://cocoapods.org/pods/RKAutoLayout)
[](https://developer.apple.com/swift)
[](https://cocoapods.org/pods/RKAutoLayout)Easy AutoLayout
## TL;DR
```swift
let view1: UIView = UIView()
let view2: UIView = UIView()view1.addSubview(view2)
/// Add all
view1.rk_alAdd(
size: [.width(view2), .height(100)],
center: [.centerX()],
edge: [.top(10), .bottom(view2, offset: -34)], isActive: false)
view1.rk_alAdd(size: [.height(100)], edge: [.top(min: 10), .bottom(view2, offset: -34)], isActive: false)
view1.rk_alAdd(center: [.centerX()], edge: [.top(10), .bottom(max: view2.topAnchor, offset: -34)])/// Edges
view1.rk_alEdgeSuperViewBounds()
view1.rk_alEdge(.top(200))
view1.rk_alEdge(.top(bottomAnchor, offset: -43))
view1.rk_alEdge(.top(0), .left(10), isActive: false)/// Size
view1.rk_alSize(.width(50), .height(view2, multiplier: 3))
view1.rk_alSize(.width(view2.heightAnchor, priority: .low), .height(view2))
view1.rk_alSize(.width(200), .height(min: 60), .height(max: 220))/// Center
view1.rk_alCenterSuperView()
view1.rk_alCenter(.centerX(100), .centerY(300))
view1.rk_alCenter(.centerX(), .centerY(view2.topAnchor))
view1.rk_alCenter(values: RKConstraintCenter.center(view2, offsetX: -100, offsetY: -100))/// Baseline
view1.rk_alBaseline(.firstBaseline(100), .lastBaseline(300))
```## Requirements
- iOS 9.0 and above
- Swift 4.1## Documentations
Full documentation for the latest release is available [here](https://daskioff.github.io/RKAutoLayout/)
## Installation
RKAutoLayout is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'RKAutoLayout', '~> 0.2'
```## Author
DaskiOFF, [email protected]
## License
RKAutoLayout is available under the MIT license. See the [LICENSE](LICENSE) file for more info.
## [Dependencies](https://ios-factor.com/dependencies)
Последний раз проект собирался с версией **Xcode** указанной в файле ```.xcode-version``` ([Подробнее](https://github.com/fastlane/ci/blob/master/docs/xcode-version.md))Последний раз проект собирался с версией **Swift** указанной в файле ```.swift-version```