Add Shadow To Collection View Cell Swift

[Solved] Add Shadow To Collection View Cell Swift | Swift - Code Explorer | yomemimo.com
Question : add shadow to collection view cell swift

Answered by : drab-duck-ew8gk1ct07zq

self.contentView.layer.cornerRadius = 2.0
self.contentView.layer.borderWidth = 1.0
self.contentView.layer.borderColor = UIColor.clear.cgColor
self.contentView.layer.masksToBounds = true
self.layer.shadowColor = UIColor.black.cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 2.0)
self.layer.shadowRadius = 2.0
self.layer.shadowOpacity = 0.5
self.layer.masksToBounds = false
self.layer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: self.contentView.layer.cornerRadius).cgPath

Source : | Last Update : Sun, 29 Mar 20

Answers related to add shadow to collection view cell swift

Code Explorer Popular Question For Swift