Skip to content

Instantly share code, notes, and snippets.

@dimkagithub
Last active November 6, 2021 06:52
Show Gist options
  • Save dimkagithub/8ed9af8adf448b57a88bf86f84e746ab to your computer and use it in GitHub Desktop.
Save dimkagithub/8ed9af8adf448b57a88bf86f84e746ab to your computer and use it in GitHub Desktop.
UIIMageView extension
extension UIImageView {
func setImageShadow() {
super.layoutSubviews()
self.layer.shadowColor = UIColor.lightGray.cgColor
self.layer.shadowOpacity = 1.0
self.layer.shadowRadius = 5.0
self.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
self.layer.cornerRadius = bounds.height / 2
self.clipsToBounds = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment