Michael Bethke
Michael Bethke

Reputation: 180

Xcode 6 Don't Apply Vibrant Effect to Child View

Good evening, everyone!

Is it possible to apply the "vibrant" visual effect to a parent view, without a child view inheriting it?

My main window has the vibrant effect applied to the entire view, but when using a popover segue to display a new view, that view is also transparent. Is there any way to prevent this?

Thanks!

Upvotes: 2

Views: 392

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

You can set the popover view's window appearance in the controller's viewWillAppear():

Swift

override func viewWillAppear() {
    self.view.window?.appearance = NSAppearance(named: NSAppearanceNameVibrantDark)
}

Obj-C

- (void)viewWillAppear {
  self.view.window.appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark];
}

Upvotes: 1

Related Questions