MortimerGoro / MGSwipeTableCell

An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions.
MIT License
6.97k stars 1.08k forks source link

Problem when using shadow #357

Open KirillStaroselskiy opened 3 years ago

KirillStaroselskiy commented 3 years ago

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 commented 3 years ago

IMG_87B64F715851-2 IMG_87B64F715851-1