# AutoLayoutX **Repository Path**: CoderLeonidas/AutoLayoutX ## Basic Information - **Project Name**: AutoLayoutX - **Description**: make your autoLayout living easily - **Primary Language**: Swift - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-05-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 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 } } ```