Easy Auto Layout

Overview

RKAutoLayout

CI Status Cocoapods compatible codecov docs Version Platform Swift Version License

Easy AutoLayout

TL;DR

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

Installation

RKAutoLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'RKAutoLayout', '~> 0.2'

Author

DaskiOFF, [email protected]

License

RKAutoLayout is available under the MIT license. See the LICENSE file for more info.

Dependencies

Последний раз проект собирался с версией Xcode указанной в файле .xcode-version (Подробнее)

Последний раз проект собирался с версией Swift указанной в файле .swift-version

You might also like...
TinyConstraints is the syntactic sugar that makes Auto Layout sweeter for human use.
TinyConstraints is the syntactic sugar that makes Auto Layout sweeter for human use.

TinyConstraints is the syntactic sugar that makes Auto Layout sweeter for human use. Features Pure Swift 5 sweetness. Everything you can do with Auto

Intuitive and powerful Auto Layout library
Intuitive and powerful Auto Layout library

Align introduces a better alternative to Auto Layout anchors. Semantic. Align APIs focus on your goals, not the math behind Auto Layout constraints. P

⚓️ Declarative, extensible, powerful Auto Layout
⚓️ Declarative, extensible, powerful Auto Layout

EasyAnchor ❤️ Support my apps ❤️ Push Hero - pure Swift native macOS application to test push notifications PastePal - Pasteboard, note and shortcut m

Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout

Masonry Masonry is still actively maintained, we are committed to fixing bugs and merging good quality PRs from the wider community. However if you're

Template auto layout cell for automatically UITableViewCell height calculating
Template auto layout cell for automatically UITableViewCell height calculating

UITableView-FDTemplateLayoutCell Overview Template auto layout cell for automatically UITableViewCell height calculating. Basic usage If you have a se

Yet Another Swift Auto Layout DSL
Yet Another Swift Auto Layout DSL

FormationLayout Documentation FormationLayout is the top level layout class for one root view. FormationLayout takes a UIView as its rootView. transla

Lightweight declarative auto-layout framework for Swift

SwiftyLayout SwiftyLayout is a framework that allows to describe layout constraints (ie NSLayoutConstraint) as a simple mathematical formula in a Swif

Minimal Auto Layout in Swift
Minimal Auto Layout in Swift

Restraint Restraint is a very very small library to help make your use of NSLayoutConstraint in Swift more legible & declarative. Like programmatic vi

Swift microframework for declaring Auto Layout constraints functionally
Swift microframework for declaring Auto Layout constraints functionally

Relayout Relayout is a Swift microframework to make using Auto Layout easier with static and dynamic layouts. Why? If you want to build a UI using App

Owner
Roman Kotov
Roman Kotov
Auto Layout made easy

EasyPeasy is a Swift framework that lets you create Auto Layout constraints programmatically without headaches and never ending boilerplate code. Besi

Carlos Vidal 1.9k Dec 23, 2022
Auto Layout In Swift Made Easy

Swiftstraints Swiftstraints can turn verbose auto-layout code: let constraint = NSLayoutConstraint(item: blueView, attr

null 119 Jan 29, 2022
Written in pure Swift, QuickLayout offers a simple and easy way to manage Auto Layout in code.

QuickLayout QuickLayout offers an additional way, to easily manage the Auto Layout using only code. You can harness the power of QuickLayout to align

Daniel Huri 243 Oct 28, 2022
Easy Auto Layout

RKAutoLayout Easy AutoLayout TL;DR let view1: UIView = UIView() let view2: UIView = UIView() view1.addSubview(view2) /// Add all view1.rk_alAdd(

Roman Kotov 1 Mar 24, 2019
Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer]

Extremely Fast views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainabl

layoutBox 2.1k Dec 22, 2022
A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:

Cartography ?? ?? Using Cartography, you can set up your Auto Layout constraints in declarative code and without any stringly typing! In short, it all

Robb Böhnke 7.3k Jan 4, 2023
Lightweight Swift framework for Apple's Auto-Layout

I am glad to share with you a lightweight Swift framework for Apple's Auto-Layout. It helps you write readable and compact UI code using simple API. A

null 349 Dec 20, 2022
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.

KVConstraintKit KVConstraintKit is a DSL to make easy & impressive Auto Layout constraints on iOS, tvOS & OSX with Swift Installation Using CocoaPods

Keshav Vishwkarma 90 Sep 1, 2022
A compact but full-featured Auto Layout DSL for Swift

Mortar allows you to create Auto Layout constraints using concise, simple code statements. Use this: view1.m_right |=| view2.m_left - 12.0 Instead of:

Jason Fieldman 83 Jan 29, 2022
The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.

The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. PureLayout extends UIView/NSView, NSArray, and NSLayoutConstrai

PureLayout 7.6k Jan 6, 2023