Skip to content

Instantly share code, notes, and snippets.

@sauravexodus
Created September 14, 2017 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sauravexodus/f45d6ebd1914ea36a2d909c1f5f099f8 to your computer and use it in GitHub Desktop.
Save sauravexodus/f45d6ebd1914ea36a2d909c1f5f099f8 to your computer and use it in GitHub Desktop.
Usage of Relative Dimensionsing
// Creating CGRects for your UIView frame
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 200.dp, height: 40.dp))
//Creating constraints
imageView.leftAnchor.constaint(equalTo: view.leftAnchor, constant: 16.dp).isActive = true
//Using as a font size
myLabel.font = UIFont.systemFont(ofSize: 13.dp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment