Anchorman alternatives and similar libraries
Based on the "Layout" category.
Alternatively, view Anchorman 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. -
QuickLayout
Written in pure Swift, QuickLayout offers a simple and easy way to manage Auto Layout in code. -
ManualLayout
✂ Easy to use and flexible library for manually laying out views and layers for iOS and tvOS. Supports AsyncDisplayKit. -
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. -
Framezilla
DISCONTINUED. Elegant library that wraps working with frames with a nice chaining syntax.
CodeRabbit: AI Code Reviews for Developers
* 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 Anchorman or a related project?
README
Anchorman
Do you think autolayout has to be hard?
[That doesn't make any sense](gifs/doesnt_make_sense.gif)
Nah. NSLayoutAnchor
is pretty neat! But it's still a bit tedious of an API. Try writing .translatesAutoresizingMaskIntoConstraints = false
and .isActive = true
10 times over. But we can make it a bit easier with a very thin layer of abstraction.
[I don't know what we're yelling about!](gifs/yelling.gif)
Let's start off with a vocabulary lesson.
UIView
and UILayoutGuide
are Anchorable
. You can pin one to the other, in any combination you like, as long as it generates valid NSLayoutConstraint
s.
How's it work?
I am a cool developer, making a cool app. It has so many views. I want to pin my view to it's superview.
self.backgroundView.pinToSuperview()
That was easy, but I don't want to pin to a superview anymore, I want to pin to another view.
self.messageLabel.pin(to: self.backgroundView)
Ah, ok. Easy enough… How about pinning my label to the left and right side of it's superview… and with insets… and center it in my view.
self.titleLabel.pinToSuperview([ .leading(10.0), .trailing(10.0), .centerY ])
Whoa, that was neat! You can specify a group of edges you want to pin to, and their offsets. Swift enums are the best!
[That escalated quickly](gifs/escalated_quickly.gif)
And of course, you can pick one edge to pin to another edge.
self.footerLabel.pin(edge: .bottom, toEdge: .bottom, of: self.view.safeAreaLayoutGuide, constant: 10.0)
Last but not least, set constant values for your constraints. For width, height, or both.
self.footerLabel.set(size: .width(44.0) ])
self.titleLabel.set(size: [ .width(44.0), .height(44.0) ])
I lied, there's a bit more. Anchorman includes a couple of goodies to make your life easier between iOS 10 and iOS 11.
var backwardsCompatibleSafeAreaLayoutGuide: UILayoutGuide
var backwardsCompatibleSafeAreaInsets: UIEdgeInsets
These will use safeAreaLayoutGuide
and safeAreaInsets
on iOS 11, and layoutMarginsGuide
and layoutMargins
on iOS 10, so you can avoid a whole bunch of if #available
conditions.
Installation
Anchorman supports Swift 4 with the latest versions. If you're looking for Swift 3 support, use version 2.0
You can use CocoaPods to install Anchorman by adding it to your Podfile:
platform :ios, '8.0'
use_frameworks!
pod 'Anchorman'
Or Carthage
github "mergesort/Anchorman"
Or install it the old fashioned way by downloading Anchorman.swift
and dropping it in your project.
About me
[I'm Ron Burgundy](gifs/im_ron_burgundy.gif)
Hi, I'm Joe! @mergesort everywhere on the web, but especially on Twitter.
License
See the [license](LICENSE) for more information about how you can use Anchorman. I promise it's not GPL, because I am not "that guy".
Fin
Hopefully Anchorman is your cup of tea, it's the kind of autolayout library I'd want to use. And with that, good night San Diego.
[Stay Classy San Diego](gifs/stay_classy.gif)
*Note that all licence references and agreements mentioned in the Anchorman README section above
are relevant to that project's source code only.