Created
November 12, 2019 19:45
Revisions
-
behrank created this gist
Nov 12, 2019 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ import UIKit import RacoonKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() //How to add subviews. let firstView = UIView() let secondView = UIView() let thirdView = UIView() let fourthView = UIView() view.addSubviews(views: firstView, secondView, thirdView, fourthView) //How to set margins to either self and other UIView subclasses firstView.setMargins(RacoonDimension.top(value: 8), RacoonDimension.left(value: 8), RacoonDimension.right(value: 8), RacoonDimension.bottom(value: 8)) firstView.setMarginTo(view: secondView, of: RacoonDimension.top(value: 12)) //How to set dimensions firstView.setHeight(100) firstView.setWidth(125) firstView.setWidthEqualToSuperview() firstView.setHeightEqualToSuperview() firstView.setWidthEqualTo(view: fourthView) firstView.setHeightEqualTo(view: secondView) firstView.setWidthEqualTo(views: secondView, thirdView, fourthView) firstView.setHeightEqualTo(views: secondView, thirdView, fourthView) } }