如何在Interface Builder中使用Blur和Vibrancy的视觉效果视图?
我把这个项目拖到视图中,然后拖动UILabel到层次结构中的最后一个视图 - contentView我假设的充满活力的效果.这会导致视图模糊不清,但没有可见的标签.在其他任何地方我将标签放在层次结构中它确实变得可见,但它只是纯黑色文本.

interface-builder ios uiblureffect uivibrancyeffect uivisualeffectview
我有一个工作的ViewController与工作UIBlurEffect.这是我的代码:
@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)
}
Run Code Online (Sandbox Code Playgroud)
现在我想在nameLabel中添加一个UIVibranyEffect.如何以编程方式将UIVibrancyEffect添加到现有的UILabel?