I have a working ViewController with working UIBlurEffect. Here is my code:
@IBOutlet weak var nameLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
let blurEffect = UIBlurEffect(style: .Light)
let blurView = UIVisualEffectView(effect: blurEffect)
blurView.frame = self.view.frame
blurView.setTranslatesAutoresizingMaskIntoConstraints(false)
self.view.insertSubview(blurView, atIndex: 0)
}
Now I would like to add a UIVibranyEffect to the nameLabel. How to add UIVibrancyEffect programatically to an existing UILabel?
You need to instantiate an UIVisualEffectView and add whatever you want to be vibrant inside it. For example: