Created
November 12, 2019 19:45
-
-
Save behrank/5d3b3990a7c10d0a502fd3d649346125 to your computer and use it in GitHub Desktop.
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 characters
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) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment