Skip to content

michaelversus/Anchorz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anchorz

[![CI Status](https://img.shields.io/travis/Michalis Karagiorgos/Anchorz.svg?style=flat)](https://travis-ci.org/Michalis Karagiorgos/Anchorz) Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 9.0+
  • Swift 4.0+

Installation

Anchorz is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Anchorz'

Usage

import UIKit
import Anchorz

class ViewController: UIViewController {

    let redView: UIView = {
        let view = UIView()
        view.backgroundColor = .red
        return view
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.addSubview(redView)
        redView.constraint(
            .top(view.topAnchor, constant: 10),
            .bottom(view.bottomAnchor, constant: 10),
            .leading(view.leadingAnchor, constant: 10),
            .trailing(view.trailingAnchor, constant: 10)
        )
    }
}

Author

Michalis Karagiorgos, [email protected]

License

Anchorz is available under the MIT license. See the LICENSE file for more info.

About

UIKit Library written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published