SuperLayout alternatives and similar libraries
Based on the "Layout" category.
Alternatively, view SuperLayout alternatives based on common mentions on social networks and blogs.
-
Masonry
Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout -
PureLayout
The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible. -
MyLinearLayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView RTL -
PinLayout
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] -
FlexLayout
FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax. -
Luminous
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform. -
MisterFusion
MisterFusion is Swift DSL for AutoLayout. It is the extremely clear, but concise syntax, in addition, can be used in both Swift and Objective-C. Support Safe Area and Size Class. -
ManualLayout
✂ Easy to use and flexible library for manually laying out views and layers for iOS and tvOS. Supports AsyncDisplayKit. -
QuickLayout
Written in pure Swift, QuickLayout offers a simple and easy way to manage Auto Layout in code. -
MondrianLayout
🏗 A way to build AutoLayout rapidly than using InterfaceBuilder(XIB, Storyboard) in iOS. -
BBLocationManager
A Location Manager for easily implementing location services & geofencing in iOS. Ready for iOS 11.
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SuperLayout or a related project?
README
[](meta/repo-banner.png) [](meta/repo-banner-bottom.png)
SuperLayout is a library that adds a few custom operators to Swift that makes using the amazing NSLayoutAnchor API for Auto Layout a breeze. SuperLayout doesn't override already-defined methods in Equatable
(such as ==
and >=
), and defines ones that are logical and easily understandable to anyone who might be inheriting your codebase or joining your team.
What It Does
In short, SuperLayout turns this:
Into this:
How it works
SuperLayout defines three custom operators: ~~
, ≥≥
, and ≤≤
that correspond to equalTo
, ≥
to greaterThanOrEqualTo
, and ≤
to lessThanOrEqualTo
, respectively.
The greater than and less than operators were chosen with practicality in mind; ≥
and ≤
have simple keyboard shortcuts (just Option
+ <
and Option
+ >
in macOS), so there's no need to copy-paste characters when writing constraints.
Installation
SuperLayout is available via CocoaPods and SwiftPM. If you're using CocoaPods, just specify this in your Podfile:
pod 'SuperLayout'
Before You Use
To use this library, you should have a basic understanding of the NSLayoutAnchor
API. If not, read up, and then check out the documentation below to get started.
NSLayoutConstraint Reference
Note: SuperLayout does not (yet) automatically turn off
translatesAutoresizingMaskIntoConstraints
for the views you'd like to manage with Auto Layout. Disabling this setting automatically is too magical for me. Feel free to create an issue if you disagree.
constraint(equalTo:) ➥ viewA.rightAnchor ~~ viewB.leftAnchor
Original
viewA.rightAnchor.constraint(equalTo: viewB.leftAnchor).isActive = true
constraint(equalTo:constant:) ➥ viewA.rightAnchor ~~ viewB.leftAnchor + C
Original
viewA.rightAnchor.constraint(equalTo: viewB.leftAnchor, constant: C).isActive = true
constraint(greaterThanOrEqualTo:) ➥ viewA.rightAnchor ≥≥ viewB.leftAnchor
Original
viewA.rightAnchor.constraint(greaterThanOrEqualTo: viewB.leftAnchor).isActive = true
constraint(greaterThanOrEqualTo:constant:) ➥ viewA.rightAnchor ≥≥ viewB.leftAnchor + C
Original
viewA.rightAnchor.constraint(greaterThanOrEqualTo: viewB.leftAnchor, constant: C).isActive = true
constraint(lessThanOrEqualTo:) ➥ viewA.rightAnchor ≤≤ viewB.leftAnchor
Original
viewA.rightAnchor.constraint(lessThanOrEqualTo: viewB.leftAnchor).isActive = true
constraint(lessThanOrEqualTo:constant:) ➥ viewA.rightAnchor ≤≤ viewB.leftAnchor + C
Original
viewA.rightAnchor.constraint(lessThanOrEqualTo: viewB.leftAnchor, constant: C).isActive = true
NSLayoutDimension Reference
constraint(equalTo:multiplier:) ➥ viewA.heightAnchor ~~ viewB.heightAnchor * M
Original
viewA.heightAnchor.constraint(equalTo: viewB.heightAnchor, multiplier: M).isActive = true
constraint(equalTo:multiplier:constant:) ➥ viewA.heightAnchor ~~ viewB.heightAnchor * M + C
Original
viewA.heightAnchor.constraint(equalTo: viewB.heightAnchor, multiplier: M, constant: C).isActive = true
constraint(equalToConstant:) ➥ viewA.heightAnchor ~~ C
Original
viewA.heightAnchor.constraint(equalToConstant: C).isActive = true
constraint(greaterThanOrEqualTo:multiplier:) ➥ viewA.heightAnchor ≥≥ viewB.heightAnchor * M
Original
viewA.heightAnchor.constraint(greaterThanOrEqualTo: viewB.heightAnchor, multiplier: M).isActive = true
constraint(greaterThanOrEqualTo:multiplier:constant:) ➥ viewA.heightAnchor ≥≥ viewB.heightAnchor * M + C
Original
viewA.heightAnchor.constraint(greaterThanOrEqualTo: viewB.heightAnchor, multiplier: M, constant: C).isActive = true
constraint(greaterThanOrEqualToConstant:) ➥ viewA.heightAnchor ≥≥ C
Original
viewA.heightAnchor.constraint(greaterThanOrEqualToConstant: C).isActive = true
constraint(lessThanOrEqualTo:multiplier:) ➥ viewA.heightAnchor ≤≤ viewB.heightAnchor * M
Original
viewA.heightAnchor.constraint(lessThanOrEqualTo: viewB.heightAnchor, multiplier: M).isActive = true
constraint(lessThanOrEqualTo:multiplier:constant:) ➥ viewA.heightAnchor ≤≤ viewB.heightAnchor * M + C
Original
viewA.heightAnchor.constraint(lessThanOrEqualTo: viewB.heightAnchor, multiplier: M, constant: C).isActive = true
constraint(lessThanOrEqualToConstant:) ➥ viewA.heightAnchor ≤≤ C
Original
viewA.heightAnchor.constraint(lessThanOrEqualToConstant: C).isActive = true
License
SuperLayout is available under the Apache 2.0 license. See [LICENSE](LICENSE) for more info.
*Note that all licence references and agreements mentioned in the SuperLayout README section above
are relevant to that project's source code only.