Skip to content

LayoutSwift - Yet another Swift Autolayout DSL for iOS

License

Notifications You must be signed in to change notification settings

OrkhanAlikhanov/LayoutSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

LayoutSwift 📐

Yet another Swift Autolayout DSL for iOS

Extracted from my work at CosmicMind/Material and updated.

Usage

override func viewDidLoad() {
  super.viewDidLoad()

  view.layout(logoView)
    .topMargin()
    .centerX()
    .height(100)
  
  view.layout(titleLabel)
    .centerX()
    .widthMargin()
    .below(logoView, 16)
}

For details, refer to the PRs for docs:

Other works

  • ChainSwift - ChainSwift 🔗 is an extension that provides chainable way of setting properties.
  • SwiftUIRouter - An experimental navigation router for SwiftUI

Installation

Swift Package Manager

Note: Instructions below are for using SwiftPM without the Xcode UI. It's the easiest to go to your Project Settings -> Swift Packages and add LayoutSwift from there.

To integrate using Apple's Swift Package Manager , without Xcode integration, add the following as a dependency to your Package.swift:

dependencies: [
  .package(url: "https://github.com/OrkhanAlikhanov/LayoutSwift.git", .upToNextMajor(from: "1.0.0"))
]

and then specify "LayoutSwift" as a dependency of the Target in which you wish to use LayoutSwift.

Manually

Just drag and drop the files in the Sources folder.

Authors

See also the list of contributors who participated in this project.

Love our work?

Hit the star 🌟 button! It helps! ❤️

License

This project is licensed under the MIT License - see the LICENSE file for details

About

LayoutSwift - Yet another Swift Autolayout DSL for iOS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages