I'm having an issue with using a UIVisualEffectView inside a custom UITableViewCell.
When the table cell is touched, the effect view seems to be switching Vibrancy on by itself which isn't the desired effect I'm after at all. Vibrancy also seems to keep itself switched on even after navigating to another view and back again.
OK. I think I found solution. The problem is with default selection of UITableViewCell. I think you code looks familiar to this:
class CustomTableViewCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
selectedBackgroundView = UIView(frame: CGRect(x: -1, y: -1, width: 1, height: 1))
selectedBackgroundView?.backgroundColor = .clear
}
}
and the effect is http://pl.tinypic.com/player.php?v=o00z1k&s=9#.WOpT5VLUTMU
but a small change a code:
class CustomTableViewCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
selectionStyle = .none
}
}
and vibrancy effect will disappear.
Note, you can set it via storyboard