Latest 0.1.2
Homepage https://github.com/rick-ke/RKLayoutLibrary
License MIT
Platforms ios 8.0
Frameworks UIKit

RKLayoutLibrary

This is an "Swift Autolayout Tool" that is easy to read and easy to coding for iOS.

Contents

Requirements

  • iOS 8.0+
  • Xcode 8.x
  • Xcode 9.x
  • Swift 3.x
  • Swift 4.x

Installation

CocoaPods

First, create Podfile that run the following command:

$ pod init

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

platform :ios, '8.0'
use_frameworks!

target '[Your Target Name]' do
    pod 'RKLayoutLibrary', '~> 0.1.2'
end

Then, run the following command:

$ pod install

Open your Xcode proje and import library

import RKLayoutLibrary

Manually

You can integrate RKLayoutLibrary into your project manually.


Usage

Quick Start

class MyViewController: UIViewController {

    let redView: UIView = {
        let view = UIView()
        view.backgroundColor = .red
        return view
    }()

    override func viewDidLoad() {
        super.viewDidLoad()

        view.addSubview(redView) { make in
            make.kLayoutCenter(equalTo: view)
            make.kLayout(.height, equalTo: view).multi(0.5)
            make.kLayoutHorizontalRatio(0.5)
        }
    }

}

General

  view.addSubview(redView)

  redView.makeLayout { make in
      make.kLayoutCenter(equalTo: view)
      make.kLayout(.height, equalTo: view).multi(0.5)
      make.kLayoutHorizontalRatio(0.5)
  }

Latest podspec

{
    "name": "RKLayoutLibrary",
    "version": "0.1.2",
    "summary": "This is an Swift Autolayout Tool that is easy to read and easy to coding for iOS.",
    "homepage": "https://github.com/rick-ke/RKLayoutLibrary",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Rick Ke",
    "source": {
        "git": "https://github.com/rick-ke/RKLayoutLibrary.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "3.2",
    "source_files": "RKLayoutLibrary/Source/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This