Description
FrameLayout is one of the fastest layout library for iOS and tvOS.
FrameLayoutKit alternatives and similar libraries
Based on the "Auto Layout" category.
Alternatively, view FrameLayoutKit alternatives based on common mentions on social networks and blogs.
-
PureLayout
The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible. -
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.
WorkOS - The modern identity platform for B2B SaaS
* 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 FrameLayoutKit or a related project?
README
FrameLayoutKit
FrameLayout is a super fast and easy to use layout library for iOS and tvOS.
For Objective-C version: NKFrameLayoutKit (Deprecated, not recommended)
Why?
Say NO to autolayout constraint nightmare:
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Installation
FrameLayoutKit is available through Swift Package Manager
(Recommended) and CocoaPods:
pod "FrameLayoutKit"
Example
This is how FrameLayoutKit layout the card view below:
let frameLayout = HStackLayout {
$0.add(VStackLayout {
$0.add(earthImageView).alignment = (.top, .center)
$0.addSpace().flexible()
$0.add(rocketImageView).alignment = (.center, .center)
})
$0.add(VStackLayout {
$0.add([nameLabel, dateLabel])
$0.addSpace(10)
$0.add(messageLabel)
$0.spacing = 5.0
})
$0.spacing = 15.0
$0.padding(top: 15, left: 15, bottom: 15, right: 15)
$0.debug = true
}
Or you can use operand syntax for shorter/cleaner code:
let frameLayout = StackFrameLayout(axis: .horizontal)
frameLayout + VStackLayout {
($0 + earthImageView).alignment = (.top, .center)
($0 + 0).flexible() // add a flexible space
($0 + rocketImageView).alignment = (.center, .center)
}
frameLayout + VStackLayout {
$0 + [nameLabel, dateLabel] // add an array of views
$0 + 10 // add space with 10 px fixed
$0 + messageLabel // add a single view
$0.spacing = 5.0 // spacing between views
}
frameLayout.spacing = 15.0
frameLayout.padding(top: 15, left: 15, bottom: 15, right: 15)
frameLayout.debug = true // show debug frame
}
Benchmark
FrameLayoutKit is one of the fastest layout libraries.
See: Layout libraries benchmark's project
Todo
- [x] Swift Package Manager
- [x] CocoaPods support
- [x] Objective-C version (Deprecated - Not recommended)
- [x] Swift version
- [x] Examples
- [ ] Documents
Author
Nam Kennic, [email protected]
License
FrameLayoutKit is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the FrameLayoutKit README section above
are relevant to that project's source code only.