I would like to give shadow effect like card similar to the image in my iOS app
I need this on UITableViewCell the image will not work for me also the the g
An improvised solution on swift 3.0:
extension UIView {
func setCardView(){
layer.cornerRadius = 5.0
layer.borderColor = UIColor.clear.cgColor
layer.borderWidth = 5.0
layer.shadowOpacity = 0.5
layer.shadowColor = UIColor.lightGray.cgColor
layer.shadowRadius = 5.0
layer.shadowOffset = CGSize(width:5, height: 5)
layer.masksToBounds = true
}
}
Usage:
On cellForRowAt indexPath:
var cell = UITableViewCell()
cell.contentView.setCardView()