Swiftpack.co - Package - Wzxhaha/Viscosity

Viscosity

swift version travis-ci Platform Cocoapods Compatible
Autolayout DSL for iOS
Simple and Powerful.

Usage

Normal

 view.vis.makeConstraints { make in
   make.left == view.vis.right *~ 2 +~ 100 ~~ .low ~| true
 }
 view.vis.makeConstraints { make in
   make.size <= 100 ~~ .low
 }
 view.vis.makeConstraints { make in
   make[.left, .right, .top] == view
   make[.width, .height] == [100, 100] 
   // equal to `make[.width, .height] == 100`
   // not equal to `make[.width, .height] == [100]`
 }

Update

 view.vis.updateConstraints { make in }

Remake

 view.vis.remakeConstraints { make in }

Operator

| Operator | Position | Description | | ---------|:--------:| -----------:| | == | mid | equal | | >= | mid | greaterThanOrEqual | | <= | mid | lessThanOrEqual | | +~ | mid | offset | | *~ | mid | multiplier | | ~~ | mid | priority | | ~| | mid | isActive |

Installation

Swift Package Manager

Package.swift

let package = Package(
    name: "XXX",
    dependencies: [
        .Package(url: "https://github.com/Wzxhaha/Viscosity", majorVersion: 2)
    ]
)

CocoaPods

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

$ gem install cocoapods

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

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target '<Your Target Name>' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'Viscosity', '~> 2.0'

end

Then, run the following command:

$ pod install

Manually

Of course, you can manually integrate it into your project.

License

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

Github

link
Stars: 18
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

2.0.0 - Mar 26, 2017

Use more concise syntax 🍬 to complete your UI layout