Stevia alternatives and similar libraries
Based on the "Layout" category.
Alternatively, view Stevia 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. -
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. -
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. -
FrameLayoutKit
A super fast and easy-to-use layout library for iOS. FrameLayoutKit supports complex layouts, including chaining and nesting layout with simple and intuitive operand syntax. -
CGLayout
Powerful autolayout framework, that can manage UIView(NSView), CALayer and not rendered views. Not Apple Autolayout wrapper. Provides placeholders. Linux support. -
JustUiKit
iOS UI Kit With Android-Style Tools. JustUiKit contains JustLinearLayout, JustFrameLayout and so on. It is designed to make Android developers build iOS UI easily. Also for iOS developers, it provides a new way to build UI.
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 Stevia or a related project?
README
Winner of Hacking with Swift Recommended award
You + Stevia = π¦
- [x] π‘ Write concise, readable layouts
- [x] π Reduce your maintenance time
- [x] π¨ Compose your styles, CSS-like
- [x] π΄ Plug Live reload and boost your iteration cycles
[Reason](#-reason) - Example - [Live Reload](#-live-reload) - [Installation](#οΈ-installation) - [Documentation](#-documentation)
πΌ Visual Layout Api
layout {
100
|-email-| ~ 80
10%
|-password-forgot-| ~ 80
>=20
|login| ~ 80
0
}
β Chainable Api
email.top(100).left(8).right(8).width(200).height(44)
alignHorizontally(password, forgot)
image.fillContainer()
button.centerInContainer().size(50%)
equalWidths(email, password)
image.width(>=80)
π Equation-Based Api
email.Top == 100
password.CenterY == forgot.CenterY
login.Top >= password.Bottom + 20
login.Width == 75 % Width
(image.Height == 100).priority = UILayoutPriority(rawValue: 999)
All Generate native NSLayoutConstraints π
π¨βπ¬Try it!
Stevia is part of freshOS iOS toolset. Try it in an example App ! Download Starter Project
π‘ Reason
Because nothing holds more truth than pure code π€
Xibs and storyboards are heavy, hard to maintain, hard to merge.
They split the view concept into 2 separate files making debugging a nightmare
There must be a better way
How
By creating a tool that makes Auto layout code finally readable by a human being.
By coupling it with live code injection such as injectionForXcode we can design views in real time
View layout becomes fun, concise, maintainable and dare I say, beautiful β€οΈ
Login View Example
In the project folder, you can find an example of a typical login view laid out in both native and Stevia for you to understand and compare the two approaches.
As a spoiler alert, the number of characters goes from 2380 to 1239 ( ~ divided by 2)
Write Half the code that is actually 10X more expressive and maintainable !
π΄ Live Reload
Live reload enables you to develop your views live without relaunching the app everytime.
Stevia + InjectionForXcode = #WhoNeedsReactNative?? π
Just Cmd+S
and you can dev live in the simulator !
Learn more about how to set up live reload here.
βοΈ Installation
Stevia
is installed via the official Swift Package Manager.
Select Xcode
>File
> Swift Packages
>Add Package Dependency...
and add https://github.com/freshOS/Stevia
.
The Swift Package Manager (SPM) is now the official way to install stevia
. The other package managers are now deprecated as of 4.8.0
and won't be supported in future versions.
For Carthage/Cocoapods support (legacy versions) see documentation here.
π Documentation
The following will teach you the gist of Stevia in one minute.
To go further, you can refer to the full documentation here.
Stevia enables you to write readable Auto Layout code. It does so by tackling the 3 main components of layout: view hierarchy, layout and styling.
01 - View hierarchy
email.translatesAutoresizingMaskIntoConstraints = false
password.translatesAutoresizingMaskIntoConstraints = false
login.translatesAutoresizingMaskIntoConstraints = false
addSubview(email)
addSubview(password)
addSubview(login)
becomes
subviews {
email
password
login
}
02 - Layout
email.topAnchor.constraint(equalTo: topAnchor, constant: 100).isActive = true
email.leftAnchor.constraint(equalTo: leftAnchor, constant: 8).isActive = true
email.rightAnchor.constraint(equalTo: rightAnchor, constant: -8).isActive = true
email.heightAnchor.constraint(equalToConstant: 80).isActive = true
password.topAnchor.constraint(equalTo: email.bottomAnchor, constant: 8).isActive = true
password.leftAnchor.constraint(equalTo: leftAnchor, constant: 8).isActive = true
password.rightAnchor.constraint(equalTo: rightAnchor, constant: -8).isActive = true
password.heightAnchor.constraint(equalToConstant: 80).isActive = true
login.topAnchor.constraint(lessThanOrEqualTo: password.bottomAnchor, constant: 20).isActive = true
login.leftAnchor.constraint(equalTo: leftAnchor).isActive = true
login.rightAnchor.constraint(equalTo: rightAnchor).isActive = true
login.heightAnchor.constraint(equalToConstant: 80).isActive = true
login.bottomAnchor.constraint(equalTo: bottomAnchor, constant: 0).isActive = true
becomes
layout {
100
|-email-| ~ 80
8
|-password-| ~ 80
>=20
|login| ~ 80
0
}
03 - Styling
email.borderStyle = .roundedRect
email.autocorrectionType = .no
email.keyboardType = .emailAddress
email.font = UIFont(name: "HelveticaNeue-Light", size: 26)
becomes
email.style { f in
f.borderStyle = .roundedRect
f.autocorrectionType = .no
f.keyboardType = .emailAddress
f.font = UIFont(name: "HelveticaNeue-Light", size: 26)
f.returnKeyType = .next
}
π¨βπ» Contributors
YannickDot, S4cha, Damien, Snowcraft, Mathieu-o, Blaz Merela, Theophane Rupin, Jason Liang, liberty4me, Scott Bates, Sai, Mike Gallagher, WaterNotWords, Mick MacCallum, Onur Genes
π₯ Backers
Like the project? Offer coffee or support us with a monthly donation and help us continue our activities :)
π² Apps using Stevia
Many top-notch Apps with millions of users use Stevia to write better Auto Layout code:
- Mobike - The worldβs first and largest bike sharing system.
- Brightspace Pulse - Education app
- NerdWallet - Credit Score, Budget, Finance
- Yatra - Flights, Hotels & Cabs
- Yummypets - The world's cutest social network for pet lovers
- Invitation Maker - Greetings, Invite & Wishes
- Logo Maker - Create & Design 10,000+ Professional Logos
- Smart Cleaner - Delete Phone Photos, Contacts
- Tuner Eclipse - Free Guitar Tuner
- and many more...
You are using Stevia ? Please let me know @[[email protected]]([email protected]) and I'll add you to the list π!
π Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site :)
Swift Version
*Note that all licence references and agreements mentioned in the Stevia README section above
are relevant to that project's source code only.