Skip to content

Instantly share code, notes, and snippets.

@alexnikol
Last active April 26, 2020 15:47
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 alexnikol/b5f5136bb654617626cdf998614bc87f to your computer and use it in GitHub Desktop.
Save alexnikol/b5f5136bb654617626cdf998614bc87f to your computer and use it in GitHub Desktop.
Basic properties of UIView
// MARK: Change cornerRadius UIView
view.layer.cornerRadius = 5
// MARK: Set shadow to UIView
view.layer.shadowOffset = CGSize(width: 5, height: 5)
view.layer.shadowOpacity = 0.7
view.layer.shadowRadius = 5
view.layer.shadowColor = UIColor.green.cgColor
// MARK: Set border to UIView
view.layer.borderColor = UIColor.green.cgColor
view.layer.borderWidth = 2.0
// MARK: Set backgroundColor to UIView
view.layer.backgroundColor = UIColor.yellow.cgColor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment