๐Ÿ— MondrianLayout - describing structured layout for AutoLayout

Overview

MondrianLayout - describing structured layout for AutoLayout

CleanShot 2021-06-17 at 21 12 03@2x

This image laied out by MondrianLayout

Layout code

HStackBlock(spacing: 2, alignment: .fill) {
  VStackBlock(spacing: 2, alignment: .fill) {
    UIView.mock(
      backgroundColor: .mondrianRed,
      preferredSize: .init(width: 28, height: 28)
    )

    UIView.mock(
      backgroundColor: .layeringColor,
      preferredSize: .init(width: 28, height: 50)
    )

    UIView.mock(
      backgroundColor: .mondrianYellow,
      preferredSize: .init(width: 28, height: 28)
    )

    UIView.mock(
      backgroundColor: .layeringColor,
      preferredSize: .init(width: 28, height: 28)
    )

    HStackBlock(alignment: .fill) {
      UIView.mock(
        backgroundColor: .layeringColor,
        preferredSize: .init(width: 28, height: 28)
      )
      UIView.mock(
        backgroundColor: .layeringColor,
        preferredSize: .init(width: 28, height: 28)
      )
    }
  }

  VStackBlock(spacing: 2, alignment: .fill) {
    HStackBlock(spacing: 2, alignment: .fill) {
      UIView.mock(
        backgroundColor: .layeringColor,
        preferredSize: .init(width: 28, height: 28)
      )
      VStackBlock(spacing: 2, alignment: .fill) {
        HStackBlock(spacing: 2, alignment: .fill) {
          UIView.mock(
            backgroundColor: .mondrianYellow,
            preferredSize: .init(width: 28, height: 28)
          )
          UIView.mock(
            backgroundColor: .layeringColor,
            preferredSize: .init(width: 28, height: 28)
          )
        }
        UIView.mock(
          backgroundColor: .layeringColor,
          preferredSize: .init(width: 28, height: 28)
        )
      }
    }

    HStackBlock(spacing: 2, alignment: .fill) {
      VStackBlock(spacing: 2, alignment: .fill) {
        UIView.mock(
          backgroundColor: .layeringColor,
          preferredSize: .init(width: 28, height: 28)
        )
        UIView.mock(
          backgroundColor: .mondrianBlue,
          preferredSize: .init(width: 28, height: 28)
        )
      }

      UIView.mock(
        backgroundColor: .layeringColor,
        preferredSize: .init(width: 28, height: 28)
      )

      VStackBlock(spacing: 2, alignment: .fill) {
        UIView.mock(
          backgroundColor: .layeringColor,
          preferredSize: .init(width: 28, height: 28)
        )
        UIView.mock(
          backgroundColor: .layeringColor,
          preferredSize: .init(width: 28, height: 28)
        )
      }
    }

    HStackBlock(spacing: 2, alignment: .fill) {
      UIView.mock(
        backgroundColor: .mondrianRed,
        preferredSize: .init(width: 28, height: 28)
      )
      VStackBlock(spacing: 2, alignment: .fill) {
        UIView.mock(
          backgroundColor: .layeringColor,
          preferredSize: .init(width: 28, height: 28)
        )
        UIView.mock(
          backgroundColor: .layeringColor,
          preferredSize: .init(width: 28, height: 28)
        )
      }
    }

  }

}
.overlay(
  UILabel.mockMultiline(text: "Mondrian Layout", textColor: .white)
    .viewBlock
    .padding(4)
    .background(
      UIView.mock(
        backgroundColor: .layeringColor
      )
      .viewBlock
    )
    .relative(bottom: 8, right: 8)
)

Strucutured layout API and Classical layout API

  • ๐ŸŒŸ Enables us to describe layout by DSL (like SwiftUI's layout).
  • ๐ŸŒŸ Automatic adding subviews according to layout representation.
  • ๐ŸŒŸ Supports integeration with system AutoLayout API.
  • ๐ŸŒŸ Provides classical layout API that describing constraints each view.

Introduction

A DSL based layout builder with AutoLayout

AutoLayout is super powerful to describe the layout and how it changes according to the bounding box.
What if we get a more ergonomic interface to declare the constraints.

like this

CleanShot 2021-06-17 at 21 13 11@2x

CleanShot 2021-06-17 at 21 14 10@2x

Future direction

  • Optimize the code - still verbose implementation because we're not sure if the API can be stable.
  • Brushing up the DSL - to be stable in describing.
  • Adding more modifiers for fine tuning in layout.
  • Tuning up the stack block's behavior.
  • Adding a way to setting constraints independently besides DSL
    • AutoLayout is definitely powerful to describe the layout. We might need to set the constraints additionally since DSL can't describe every pattern of the layout.

Demo app

You can see many layout examples from the demo application.

Simulator.Screen.Recording.-.iPhone.8.-.2021-06-20.at.02.48.38.mp4

Overview

MondrianLayout enables us to describe layouts of subviews by DSL (powered by resultBuilders)
It's like describing in SwiftUI, but this behavior differs a bit since laying out by AutoLayout system.

To describe layout, use buildSublayersLayout as entrypoint.
This method creates a set of NSLayoutConstraint, UILayoutGuide, and modifiers of UIView.
Finally, those apply. You don't need to call addSubview. that goes automatically according to hierarchy from layout descriptions.

class MyView: UIView {

  let nameLabel: UILabel
  let detailLabel: UILabel

  init() {
    super.init(frame: .zero)
    
    // Seting up constraints constraints, layoutGuides and adding subviews
    buildSublayersLayout {
      VStackBlock {
        nameLabel
        detailLabel
      }
    }
    
    // Seting up constraints for the view itself.
    buildSelfSizing {
      $0.width(200).maxHeight(...)... // can be method cain.
    }
    
  }
}

Examples

Sample code assumes run in UIView. (self is UIView)
You can replace it with UIViewController.view.

Layout subviews inside safe-area

Attaching to top and bottom safe-area.

self.buildSublayersLayout(safeArea: .vertical) {
  ...
}

Put a view snapping to edge

self.buildSublayersLayout {
  ZStackBlock {
    backgroundView.viewBlock.relative(0)    
  }
}

Add constraints to view itself

self.buildSelfSizing {
  $0.width(...)
    .height(...)          
}

Detail

Vertically and Horizontally Stack layout

VStackBlock

Alignment

center(default) leading trailing fill
CleanShot 2021-06-17 at 00 06 10@2x CleanShot 2021-06-17 at 00 05 19@2x CleanShot 2021-06-17 at 00 05 33@2x CleanShot 2021-06-17 at 00 05 42@2x

HStackBlock

center(default) top bottom fill
CleanShot 2021-06-17 at 00 09 43@2x CleanShot 2021-06-17 at 00 09 51@2x CleanShot 2021-06-17 at 00 09 59@2x CleanShot 2021-06-17 at 00 10 06@2x
buildSublayersLayout {
  VStackBlock(spacing: 4, alignment: alignment) {
    UILabel.mockMultiline(text: "Hello", textColor: .white)
      .viewBlock
      .padding(8)
      .background(UIView.mock(backgroundColor: .mondrianYellow))
    UILabel.mockMultiline(text: "Mondrian", textColor: .white)
      .viewBlock
      .padding(8)
      .background(UIView.mock(backgroundColor: .mondrianRed))
    UILabel.mockMultiline(text: "Layout!", textColor: .white)
      .viewBlock
      .padding(8)
      .background(UIView.mock(backgroundColor: .mondrianBlue))
  }
}

Background modifier

label
  .viewBlock // To enable view describes layout
  .padding(8)
  .background(backgroundView)

CleanShot 2021-06-17 at 00 14 52@2x

Overlay modifier

// TODO:

Related modifier

// TODO:

ZStackBlock

// TODO:

Classic Layout API

Structured layout API(DSL) does not cover the all of use-cases.
Sometimes we still need a way to describe constraints for a complicated layout.

MondrianLayout provides it as well other AutoLayout libraries.

Activate constraints independently

view.layout
  .width(10)
  .topToSuperview()
  .rightToSuperview()
  .leadingToSuperview()
  .activate() // activate constraints and returns `ConstraintGroup`

*Batch layout

// returns `ConstraintGroup`
batchLayout {

  box1.layout
    .topToSuperview()
    .leftToSuperview()
    .right(to: box2, .left)
    .bottomToSuperview()

  box2.layout
    .topToSuperview(.top, .constant(10))
    .rightToSuperview()
    .bottomToSuperview()
}

Installation

CocoaPods

pod "MondrianLayout"

SwiftPM

") ] ">
dependencies: [
    .package(url: "https://github.com/muukii/MondrianLayout.git", exact: "")
]

LICENSE

MondrianLayout is released under the MIT license.

Comments
  • Feature Request: Support size equalities in views / layoutGuides

    Feature Request: Support size equalities in views / layoutGuides

    Sample syntax:

    button2.mondrian.buildSelfSizing {
        $0.width(.like(button1), .exact(0)).height(.like(button1), .exact(0))
    }
    button1.mondrian.buildSelfSizing {
        $0.minWidth(60).minHeight(44)
    }
    
    opened by JohnEstropia 5
  • Feature Request: Support `_VStackItemConvertible` etc. on `UILayoutGuide`

    Feature Request: Support `_VStackItemConvertible` etc. on `UILayoutGuide`

    Since VStacks and HStacks currently only supports alignments and not "distributions" or "justification", I think UILayoutGuides can help fill that gap (especially after https://github.com/muukii/MondrianLayout/issues/47 is implemented)

    opened by JohnEstropia 3
  • Feature Request: Support width/height and their min/max variants for V/H/Z stack blocks themselves

    Feature Request: Support width/height and their min/max variants for V/H/Z stack blocks themselves

    Sample use cases:

    HStackBlock(alignment: .center) {
        buttonIconView
        buttonTitleLabel
        disclosureIndicatorView
    }
    .minHeight(44)
    
    ZStackBlock {
        resizableProfileImageView
        glossyOverlayView
    }
    .padding(3)
    .size(60)
    .background(resizablePhotoFrameView)
    
    opened by JohnEstropia 2
  • Add `Mondrian.`

    Add `Mondrian.`

    Renames two methods of laying out in favor of this proposal. https://github.com/muukii/MondrianLayout/issues/71

    view.mondrian.buildSubviews { -> Mondrian.buildSubviews(on: view) { mondrianBatchLayout { -> Mondrian.layout {

    s/([^ ]+).mondrian.buildSubviews \{/Mondrian.buildSubviews(on: $1) {

    Tag: Breaking Change 
    opened by muukii 1
  • Introduce descriptor for multiplied constraints

    Introduce descriptor for multiplied constraints

    still under the consideration of the syntax.

    a.width(.toSuperview.width, multiplier: 1)
    
    a.width(.to(b).width, multiplier: 1)
    
    a.width(.to(b).width, .exact(10), multiplier: 1)
    
    • [x] Review the syntax
    • [x] Add tests
    Group: Enhancements 
    opened by muukii 1
  • ๐ŸšจBreaking change๐Ÿšจ constants works as inverted in right, bottom, trailing

    ๐ŸšจBreaking change๐Ÿšจ constants works as inverted in right, bottom, trailing

    Before

    view.mondrian.layout.bottom(.toSuperview, -10)
    view.mondrian.layout.bottom(.toSuperview, .max(-10))
    

    After

    view.mondrian.layout.bottom(.toSuperview, 10)
    view.mondrian.layout.bottom(.toSuperview, .min(10))
    
    Tag: Breaking Change 
    opened by muukii 0
  • Creates a layout-guide for RelativeBlock in ZStackBlock

    Creates a layout-guide for RelativeBlock in ZStackBlock

    previously, the following doesn't work correctly.

    ZStackBlock {
        UIView.mock(
          backgroundColor: .layeringColor,
          preferredSize: .smallSquare
        )
        .viewBlock
        .padding(.horizontal, 20)
        .alignSelf(.attach([.horizontal, .bottom]))
      }
    
    Tag: Breaking Change Group: Fixing Issues 
    opened by muukii 0
  • Proposal: Unified API entry points

    Proposal: Unified API entry points

    What do you think of using a unified entry point for Mondrian APIs? Currently, we have these:

    // Classic
    mondrianBatchLayout {
        backgroundView.mondrian.layout
            .edges(.toSuperview)
    }
    
    // Structured
    view.mondrian.buildSubviews {
        ZStackBlock {
            button.viewBlock
                .size(size)
                .padding(padding)
        }
    }
    

    One big problem we have is that it's very hard to recall which methods to use because the API entry points are all different.

    I propose something like:

    // Classic
    Mondrian.layout {
        backgroundView.mondrian.layout
            .edges(.toSuperview)
    }
    
    // Structured
    Mondrian.buildSubviews(view) {
        ZStackBlock {
            button.mondrian.build
                .size(size)
                .padding(padding)
        }
    }
    

    The names I used (Mondrian.layout, mondrian.layout, .mondrian.build) are all placeholders. The naming can be decided later, but my proposal is based on three principles:

    1. The global entry point (Mondrian.* in the example above) would become the same entry point for both classic and structured layout syntaxes.
    2. We will define two terms we would use to separate the classic and structured layout contexts. In the example above, I used
      • Layout for classic layout (Mondrian.layout(), backgroundView.mondrian.layout)
      • Build for structured layout (Mondrian.buildSubviews(), button.mondrian.build)
    3. The subview namespace is easily remembered from the enclosing context. So inside Mondrian.layout(), views would use .mondrian.layout and inside Mondrian.buildSubviews()views would use .mondrian.build. They don't have to be the same, but the pair should be very memorable. For example: Mondrian.build*() with inner view.mondrianBlock (building blocks)

    This is a breaking change from the current syntax, but I think the biggest annoyance with the API right now is the bad discoverability of the methods. If you think the guidelines above are good, then we can comment on this Github issue on naming ideas.

    opened by JohnEstropia 3
  • Feature Request:  Allow Stack children to attach to safe areas

    Feature Request: Allow Stack children to attach to safe areas

    Currently we have LayoutContainer for this, but we cannot use it inside a ZStackBlock, for example. Alternatively, we can have _ZStackItem support something like .alignSelf(.attach(.safeArea(.top)))

    opened by JohnEstropia 7
  • Add a way to get specific constraint to animate components.

    Add a way to get specific constraint to animate components.

    UI often runs animations with updating the constant value of the constraint. Mondrian API is a faster way to get the whole layout, but still not have a way to get one of the constraints which would be used in animation.

    opened by muukii 4
Releases(0.10.0)
  • 0.10.0(Sep 2, 2022)

    What's Changed

    • Supports for-in loop inside block by @muukii in https://github.com/FluidGroup/MondrianLayout/pull/77

    Full Changelog: https://github.com/FluidGroup/MondrianLayout/compare/0.9.0...0.10.0

    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Sep 2, 2022)

    What's Changed

    • Add .container() by @muukii in https://github.com/FluidGroup/MondrianLayout/pull/74

    Full Changelog: https://github.com/FluidGroup/MondrianLayout/compare/0.8.0...0.9.0

    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Dec 20, 2021)

    What's Changed

    • Add Mondrian. by @muukii in https://github.com/muukii/MondrianLayout/pull/73

    Full Changelog: https://github.com/muukii/MondrianLayout/compare/0.7.0...0.8.0

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Dec 15, 2021)

    What's Changed

    • [Early development] Introduce VGridBlock by @muukii in https://github.com/muukii/MondrianLayout/pull/70

    Full Changelog: https://github.com/muukii/MondrianLayout/compare/0.6.0...0.7.0

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Dec 15, 2021)

    What's Changed

    • Update Builder by @muukii in https://github.com/muukii/MondrianLayout/pull/67
    • Update AnyView handling deinit by @muukii in https://github.com/muukii/MondrianLayout/pull/68
    • Remove AnyView by @muukii in https://github.com/muukii/MondrianLayout/pull/72

    Full Changelog: https://github.com/muukii/MondrianLayout/compare/0.5.0...0.6.0

    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Nov 25, 2021)

    What's Changed

    • Add LayoutManager by @muukii in https://github.com/muukii/MondrianLayout/pull/66

    Full Changelog: https://github.com/muukii/MondrianLayout/compare/0.4.0...0.5.0

    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Nov 24, 2021)

    What's Changed

    • Add optional identifier parameter in classic-layout by @muukii in https://github.com/muukii/MondrianLayout/pull/63
    • Supports conditional building layouts by @muukii in https://github.com/muukii/MondrianLayout/pull/65

    Full Changelog: https://github.com/muukii/MondrianLayout/compare/0.3.0...0.4.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Oct 28, 2021)

    What's Changed

    • Supports CGFloat directly by @muukii in https://github.com/muukii/MondrianLayout/pull/60
    • ๐ŸšจBreaking change๐Ÿšจ constants works as inverted in right, bottom, trailing by @muukii in https://github.com/muukii/MondrianLayout/pull/61

    Full Changelog: https://github.com/muukii/MondrianLayout/compare/0.2.0...0.3.0

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Oct 28, 2021)

    What's Changed

    • Supports multiple describing layout blocks and layout containers in one place. by @muukii in https://github.com/muukii/MondrianLayout/pull/59

    Full Changelog: https://github.com/muukii/MondrianLayout/compare/0.1.0...0.2.0

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Oct 28, 2021)

    Number of PRs : 4

    |tag|number of PRs| |--|--:| |Breaking Change | 2|

    Group: Fixing Issues (1)

    • Creates a layout-guide for RelativeBlock in ZStackBlock #56 by @muukii
      • Breaking Change

    Group: Enhancements (2)

    • Remove deprecated methods #58 by @muukii
      • Breaking Change
    • Add AnyView #55 by @muukii

    Other (1)

    • Revert "Creates a layout-guide for RelativeBlock in ZStackBlock" #57 by @muukii

    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.16(Sep 25, 2021)

    Number of PRs : 1

    |tag|number of PRs| |--|--:|

    Group: Enhancements (1)

    • Update ViewBlock - setting hugging and compression-resistance by axis-mask #54 by @muukii

    Other (0)


    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.15(Sep 13, 2021)

    Number of PRs : 3

    |tag|number of PRs| |--|--:|

    Group: Enhancements (3)

    • Supports including layout-guide in Structured layout #53 by @muukii
    • Update Sizing expressions #52 by @muukii
    • Support more complex operations in MondrianArrayBuilder #51 by @muukii

    Other (0)


    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.14(Sep 7, 2021)

  • 0.0.12(Jul 29, 2021)

    Number of PRs : 5

    |tag|number of PRs| |--|--:| |Breaking Change | 1|

    Group: Enhancements (5)

    • Support optional value in resultBuilder #41 by @muukii
    • Fix LayoutDescriptor #39 by @muukii
    • Remove type parameter from LayoutContainer #38 by @muukii
      • Breaking Change
    • Update Overlay Background #37 by @muukii
    • Update relative, padding modifier - supports CGFloat #36 by @muukii

    Other (0)


    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.11(Jul 12, 2021)

    Number of PRs : 7

    |tag|number of PRs| |--|--:| |Breaking Change | 2|

    Group: Enhancements (7)

    • Power up - positioning in container (RelativeBlock_ #35 by @muukii
    • Available to set constraints value from literal double or int #34 by @muukii
    • Update RelativeBlock #33 by @muukii
    • Improvement Relative and fixing relative padding behavior #32 by @muukii
    • Update Relative #31 by @muukii
      • Breaking Change
    • Add horizontal, vertical in classic layout API #28 by @muukii
    • Update naming : .constant -> .exact #29 by @muukii
      • Breaking Change

    Other (0)


    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.8(Jul 3, 2021)

    Number of PRs : 1

    |tag|number of PRs| |--|--:|

    Group: Enhancements (1)

    • Bring type to outside of generic type to make code completion better #27 by @muukii

    Other (0)


    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.7(Jul 3, 2021)

    Number of PRs : 2

    |tag|number of PRs| |--|--:| |Breaking Change | 1|

    Group: Enhancements (2)

    • Update Classic Layout API #26 by @muukii
    • API changes in classic layout #25 by @muukii
      • Breaking Change

    Other (0)


    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.6(Jun 24, 2021)

  • 0.0.5(Jun 24, 2021)

    Number of PRs : 5

    |tag|number of PRs| |--|--:| |Breaking Change | 1|

    Group: Enhancements (3)

    • Rename buildSublayersLayout -> buildSubviews #21 by @muukii
    • Add .mondrian #20 by @muukii
      • Breaking Change
    • Update Overlay Background blocks #15 by @muukii

    Other (2)

    • Add some shortcuts #18 by @ntnmrndn
    • Preparative pr #17 by @ntnmrndn

    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.4(Jun 20, 2021)

    Number of PRs : 2

    |tag|number of PRs| |--|--:|

    Group: Enhancements (1)

    • Introduce LayoutContainer - to support safeArea more flexible. #12 by @muukii

    Other (1)

    • Use https to describes packages #11 by @muukii

    Generated by chglog Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Jun 19, 2021)

  • 0.0.2(Jun 18, 2021)

    Number of PRs : 6

    |tag|number of PRs| |--|--:|

    Group: Enhancements (6)

    • Optimize code #9 by @muukii
    • Fix method chain - spacing before and after #7 by @muukii
    • Shrinking stack container itself when as well using alignment except .fill #5 by @muukii
    • Update RelativeBlock #3 by @muukii
    • Add variant relative modifier #2 by @muukii
    • Update ZStackBlock's behavior - it expands the view to ZStackBlock's size if could be. #1 by @muukii

    Other (0)


    Generated by chglog Source code(tar.gz)
    Source code(zip)
Owner
Muukii
Swift & iOS - Working on creating apps and open-sourced libraries. I'm interested in Creating smooth and fancy UI, State-Management, Image Processing.
Muukii
Powerful autolayout framework, that can manage UIView(NSView), CALayer and not rendered views. Not Apple Autolayout wrapper. Provides placeholders. Linux support.

CGLayout Powerful autolayout framework, that can manage UIView(NSView), CALayer and not rendered views. Has cross-hierarchy coordinate space. Implemen

Koryttsev Denis 45 Jun 28, 2022
Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout

Masonry Masonry is still actively maintained, we are committed to fixing bugs and merging good quality PRs from the wider community. However if you're

null 18k Jan 5, 2023
Auto Layout (and manual layout) in one line.

Auto Layout (and manual layout) in one line. Quick Look view.bb.centerX().below(view2).size(100) Itโ€™s equivalent to iOS 9 API: view.centerXAnchor.cons

Javier Zhang 74 Oct 19, 2022
Auto Layout made easy with the Custom Layout.

Auto Layout made easy with the Custom Layout. Getting started CocoaPods CocoaPods is a dependency manager for Cocoa projects. You can install it with

Malith Nadeeshan 1 Jan 16, 2022
AppStoreClone - Understanding the complex layout of app store using UICompositional layout in swift

AppStoreClone Understanding the complex layout of app store using UICompositiona

Dheeraj Kumar Sharma 8 Dec 28, 2022
A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewFlowLayout.

WrapLayout A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewF

Hiroshi Kimura 6 Sep 27, 2022
Write concise Autolayout code

Winner of Hacking with Swift Recommended award You + Stevia = ?? ?? Write concise, readable layouts ?? Reduce your maintenance time ?? Compose your st

Fresh 3.3k Jan 6, 2023
๐Ÿ“ฑAutoLayout can be set differently for each device

DeviceLayout DeviceLayout is a Swift framework that lets you set Auto Layout constraints's differently for each device Using only IBInspector of Xcode

Cruz 171 Oct 11, 2022
An easier and faster way to code Autolayout

EZAnchor ไธญๆ–‡ไป‹็ป An easier way to code Autolayout Are you annoyed of coding .active = true while using Autolayout Anchors over and over again? Are you an

Alex.Liu 25 Feb 20, 2022
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.

MisterFusion MisterFusion makes more easier to use AutoLayout in Swift & Objective-C code. Features Simple And Concise Syntax Use in Swift and Objecti

Taiki Suzuki 316 Nov 17, 2022
The fast path to autolayout views in code

NorthLayout The fast path to autolayout views in code Talks https://speakerdeck.com/banjun/auto-layout-with-an-extended-visual-format-language at AltC

banjun 36 Jul 15, 2022
A Swift Autolayout DSL for iOS & OS X

SnapKit is a DSL to make Auto Layout easy on both iOS and OS X. โš ๏ธ To use with Swift 4.x please ensure you are using >= 4.0.0 โš ๏ธ โš ๏ธ To use with Swift

null 19.1k Jan 2, 2023
This "Calculator" application is a simple one screen design of calculator screen i have made this single screen design application just to practice AutoLayout concepts.

Calculator Layout This "Calculator" application is a simple one screen design of calculator screen i have made this single screen design application j

Chetan Parate 1 Oct 29, 2021
A bit of steroids for AutoLayout, powered by Swift.

AutoLayoutPlus AutoLayoutPlus is a Swift library consisting in a set of extensions to help dealing with Auto Layout programatically. With AutoLayoutPl

Rui Costa 27 Jul 25, 2022
Tiny Swift DSL for Autolayout

SwiftAutoLayout SwiftAutoLayout is a tiny DSL for Autolayout intended to provide a more declarative way to express layout constraints. Here's a quick

Indragie Karunaratne 657 Sep 18, 2022
An autolayout library for the damn fine citizens of San Diego.

Anchorman Do you think autolayout has to be hard? Nah. NSLayoutAnchor is pretty neat! But it's still a bit tedious of an API. Try writing .translatesA

Joe Fabisevich 79 May 25, 2022
Minimal AutoLayout convenience layer. Program constraints succinctly.

MiniLayout Minimal AutoLayout convenience layer. Program constraints succinctly. Usage Put label over textField // using MiniLayout: view.constrain(la

Yonat Sharon 8 Jul 7, 2021
A AutoLayout Utility for iOS

QLayout is an Utility to make Auto Layout easy on iOS. Contents Requirements Installation Usage Credits License Requirements iOS 8.0+ Swift 3.0+ Insta

Jose Quintero 3 Nov 14, 2021
AutoLayout Micro DSL SPM from Chris Eidhof's article

EasyAutoLayout Intro EasyAutoLayout is a small framework built using the ideas presented in the article called Autolayout Micro DSL by Chris Eidhof. I

Alexandre Garrefa 0 Nov 28, 2021