I would like my table view section headers text to be rendered in the vibrant style, where the underlying UI shines through the text. I have tried the following, but nothing appears for the header as if I returned nil
.
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
//Add vibrancy text effect
let blurEffect = UIBlurEffect(style: .Light)
let vibrancyEffect = UIVibrancyEffect(forBlurEffect: blurEffect)
let vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
//Label for vibrant text
let vibrantLabel = UILabel()
vibrantLabel.text = "testing"
vibrantLabel.font = UIFont.systemFontOfSize(11.0)
vibrantLabel.textColor = UIColor(white: 0.64, alpha: 1)
vibrancyEffectView.contentView.addSubview(vibrantLabel)
return vibrancyEffectView
}