Skip to content

Instantly share code, notes, and snippets.

@alexnikol
Last active Apr 26, 2020
Embed
What would you like to do?
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