All Projects → freshOS → Stevia

freshOS / Stevia

Licence: mit
🍃 Concise Autolayout code

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Stevia

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 UITab…
Stars: ✭ 4,152 (+30.48%)
Mutual labels:  xcode, cocoapods, view, layout, autolayout, constraints, storyboard, xib
Snapkit
A Swift Autolayout DSL for iOS & OS X
Stars: ✭ 18,091 (+468.54%)
Mutual labels:  xcode, cocoapods, layout, autolayout, constraints, auto
Kvconstraintkit
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.
Stars: ✭ 91 (-97.14%)
Mutual labels:  carthage, view, layout, autolayout, constraints, auto
Tangramkit
TangramKit is a powerful iOS UI framework implemented by Swift. 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,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView
Stars: ✭ 984 (-69.08%)
Mutual labels:  xcode, cocoapods, view, autolayout, constraints, storyboard
Cyltabbarcontroller
[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
Stars: ✭ 6,605 (+107.57%)
Mutual labels:  xcode, cocoapods, view, storyboard, xib
Localize
Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings.
Stars: ✭ 253 (-92.05%)
Mutual labels:  xcode, cocoapods, carthage, storyboard
Autoinch
优雅的iPhone全尺寸/等比例精准适配工具
Stars: ✭ 395 (-87.59%)
Mutual labels:  layout, autolayout, auto, storyboard
Tinyconstraints
Nothing but sugar.
Stars: ✭ 3,721 (+16.94%)
Mutual labels:  layout, constraints, auto, nslayoutconstraints
Core Layout
Flexbox & CSS-style Layout in Swift.
Stars: ✭ 215 (-93.24%)
Mutual labels:  carthage, layout, autolayout, constraints
Easyswiftlayout
Lightweight Swift framework for Apple's Auto-Layout
Stars: ✭ 345 (-89.16%)
Mutual labels:  xcode, layout, autolayout, constraints
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (-86.3%)
Mutual labels:  xcode, cocoapods, carthage, storyboard
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+65.52%)
Mutual labels:  xcode, cocoapods, carthage, storyboard
Irldocumentscanner
A drop-in Objective-C ViewController that will Automatically scan a document for you you.
Stars: ✭ 172 (-94.59%)
Mutual labels:  xcode, cocoapods, carthage
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-95.03%)
Mutual labels:  xcode, cocoapods, carthage
Shsearchbar
The search bar that doesn't suck.
Stars: ✭ 206 (-93.53%)
Mutual labels:  xcode, cocoapods, carthage
Swiftcolorgen
A tool that generate code for Swift projects, designed to improve the maintainability of UIColors
Stars: ✭ 152 (-95.22%)
Mutual labels:  xcode, cocoapods, storyboard
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (-90.7%)
Mutual labels:  xcode, cocoapods, carthage
Audioindicatorbars
AIB indicates for your app users which audio is playing. Just like the Podcasts app.
Stars: ✭ 279 (-91.23%)
Mutual labels:  xcode, cocoapods, carthage
SuperPuperDuperLayout
Super puper duper mega easy awesome wrapper over auto layout!!111!!1!!!1!!!11111!!!1!!
Stars: ✭ 14 (-99.56%)
Mutual labels:  layout, constraints, auto
VanillaConstraints
🍦 Simplified and chainable AutoLayout constraints for iOS.
Stars: ✭ 42 (-98.68%)
Mutual labels:  layout, constraints, autolayout

Stevia

Documentation Language: Swift 2, 3, 4 and 5 Platform: iOS 8+ Carthage compatible CocoaPods compatible Swift Build Status codebeat badge License: MIT 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
    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:

You are using Stevia ? Please let me know @[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 the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].