Latest 4.4.0
Homepage https://github.com/s4cha/Stevia
License MIT
Platforms ios 8, tvos 10.2, requires ARC

Stevia

Documentation
Language: Swift 2, 3 and 4
Platform: iOS 8+
Carthage compatible
CocoaPods compatible
Build Status
codebeat badge
License: MIT
[CocoaPods]()
[CocoaPods]()
GitHub contributors
[GitHub tag]()


Drawing


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

ReasonExampleLive ReloadInstallationDocumentation

🖼 Visual Layout Api

layout(
    100,
    |-email-| ~ 80,
    8,
    |-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?? 🚀

SteviaLayout

Just Cmd+S and you can dev live in the simulator !

Learn more about how to set up live reload here.

⚙️ Installation

Get started here.

📖 Documentation

You can find the full documentation here.

👨‍💻 Contributors

YannickDot, S4cha, Damien,
Snowcraft, Mathieu-o,
Blaz Merela,
Theophane Rupin,
Jason Liang,
liberty4me,
Scott Bates,
Sai,
Mike Gallagher,
WaterNotWords,
Mick MacCallum

👥 Backers

Like the project? Offer coffee or support us with a monthly donation and help us continue our activities :)

SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout

🏅 Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site :)

SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout
SteviaLayout

Swift Version

Latest podspec

{
    "name": "SteviaLayout",
    "version": "4.4.0",
    "summary": "Elegant view layout for iOS",
    "homepage": "https://github.com/s4cha/Stevia",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "S4cha",
    "source": {
        "git": "https://github.com/s4cha/Stevia.git",
        "tag": "4.4.0"
    },
    "social_media_url": "https://twitter.com/sachadso",
    "source_files": "Source/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "8",
        "tvos": "10.2"
    },
    "description": "Elegant view layout for iOS :leaves: - Auto layout code finally readable by a human being",
    "module_name": "Stevia"
}

Pin It on Pinterest

Share This