harryzjm / Bricks

A Swift Autolayout for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bricks

Bricks make Auto Layout easy on both iOS and OS X.

Requirements

  • iOS 9.0+
  • Xcode 9.0+
  • Swift 4.0

Installation

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SwipeMenu into your Xcode project using Carthage, specify it in your Cartfile:

github "harryzjm/Bricks"

Run carthage to build the framework.

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate SMWaterFlowLayout into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'bricks'
end

Then, run the following command:

$ pod install

Source File

Simply add the file in Source directory into your project.

Usage

import bricks
func newView() -> UIView {
    let view = UIView()
    view.backgroundColor = UIColor(hue: CGFloat(arc4random_uniform(255)) / 255, saturation: 1, brightness: 1, alpha: 1)
    return view
}

let container1 = UIView()
let container2 = UIView()
let container3 = UIView()
let container4 = UIView()

view.make(space: 0, axis: .vertical, margin: true, views: container1, container2, container3, container4)

container1.make(length: 20, axis: .horizontal, margin: true, views: newView(), newView(), newView(), newView())
container2.make(length: 60, axis: .horizontal, views: newView(), newView(), newView(), newView())
container3.make(space: 5, axis: .horizontal, views: newView(), newView(), newView(), newView())
newView().edges(superView: container4, horizontal: 100, vertical: 5)

Communication

  • If you need help, open an issue or send an email.
  • If you found a bug, open an issue or send an email.
  • If you'd like to ask a question,open an issue or send an email.
  • If you want to contribute, submit a pull request.

License

Bricks is released under the MIT license. See LICENSE for details.

AuthoršŸ˜¬

Hares - https://github.com/harryzjm
Blog: https://harryzjm.github.io/
Email: harryzjm@live.com

About

A Swift Autolayout for iOS

License:MIT License


Languages

Language:Swift 97.9%Language:Objective-C 2.1%