Giter Club home page Giter Club logo

stevia's Introduction

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 = ๐Ÿฆ„

  • ๐Ÿ’ก Write concise, readable layouts
  • ๐Ÿ– Reduce your maintenance time
  • ๐ŸŽจ Compose your styles, CSS-like
  • ๐Ÿ”ด Plug Live reload and boost your iteration cycles

Reason - Example - Live Reload - Installation - Documentation

๐Ÿ–ผ 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?? ๐Ÿš€

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 :)

๐Ÿ… Sponsors

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

Swift Version

stevia's People

Contributors

s4cha avatar yannickdot avatar mickmaccallum avatar ezisazis avatar cowgp avatar n13 avatar tmcw avatar waternotwords avatar onurgenes avatar liberty4me avatar szotp avatar gitter-badger avatar sai-prasanna avatar pjambet avatar philiptrauner avatar orta avatar khaelou avatar madhavajay avatar mpsnp avatar nemesis avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.