MGSwipeTableCell icon indicating copy to clipboard operation
MGSwipeTableCell copied to clipboard

Problem when using shadow

Open KirillStaroselskiy opened this issue 4 years ago • 1 comments

Hey! I'm having a problem. I am using drop shadow for cells in my table. when the swipe is triggered the cell darkens, how can I fix it?

` import UIKit import MGSwipeTableCell

class FileTableViewCell: MGSwipeTableCell {

// MARK: - Outlets

@IBOutlet weak var containerView: UIView!{
    didSet{
        containerView.layer.masksToBounds = true

        containerView.layer.cornerRadius = 12
        containerView.layer.borderWidth = 1
        containerView.layer.borderColor = UIColor.black.withAlphaComponent(0.07).cgColor
        
    }
}

@IBOutlet weak var iconImage: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var descriptionLabel: UILabel!


override func awakeFromNib() {
    super.awakeFromNib()
    backgroundColor = .clear
    contentView.backgroundColor = .clear

    layer.masksToBounds = false
    layer.shadowColor = UIColor.black.withAlphaComponent(0.07).cgColor
    layer.shadowOffset = CGSize(width: 0, height: 3)
    layer.shadowOpacity = 1
    layer.shadowRadius = 15
    
}


func fillCell(directory: Directory) {
    nameLabel.text = directory.name
    if let description =  directory.description {
        descriptionLabel.isHidden = false
        descriptionLabel.text = description
    } else {
        descriptionLabel.isHidden = true
    }
    
    iconImage.image = directory.image
}

} `

KirillStaroselskiy avatar Feb 18 '21 17:02 KirillStaroselskiy

IMG_87B64F715851-2 IMG_87B64F715851-1

KirillStaroselskiy avatar Feb 18 '21 17:02 KirillStaroselskiy