Skip to content

javaliker/AutoLayoutX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

AutoLayoutX

make your autoLayout living easily

class ViewController: NSViewController {

    lazy var subView: NSView = {
        let subView = NSView()
        subView.wantsLayer = true
        subView.translatesAutoresizingMaskIntoConstraints = false
        subView.layer?.backgroundColor = NSColor.red.cgColor
        self.view.addSubview(subView)
        return subView
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.configConstraints()
        // Do any additional setup after loading the view.
    }


    func configConstraints() {
        
        subView.top    =  self.view.top + 20
        subView.bottom =  self.view.bottom - 20
        subView.left   =  self.view.left + 20
        subView.right  =  self.view.right - 20
    }

}

About

make your autoLayout living easily

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages