Skip to content

Instantly share code, notes, and snippets.

@milanpanchal
Last active March 17, 2021 08:21
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 milanpanchal/ea5b9218785afb806957f6450a2bb80b to your computer and use it in GitHub Desktop.
Save milanpanchal/ea5b9218785afb806957f6450a2bb80b to your computer and use it in GitHub Desktop.
[iOS Blog] UIView Shadow Example - Updated
private func setupShadowView() {
shadowView.layer.cornerRadius = 12
shadowView.layer.shadowOffset = CGSize(width: 10, height: 10) // Spread x, y
shadowView.layer.shadowOpacity = 0.5 // opacity, 50%
shadowView.layer.shadowRadius = 1.0 // divide the blur by iOS screen scale factor
shadowView.layer.shadowColor = UIColor.black.cgColor
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment