Search code examples
iosuitableviewuivisualeffectviewuiblureffectuivibrancyeffect

iOS Change color of label affected by UIVibrancyEffect


Is there a way to somehow affect the color of a label which is under vibrancy effect or at least bring some contrast by setting some tint/alpha/background/whatever properties? As you can see below, in my case the vibrancy created almost unreadable text...

enter image description here


Solution

  • When I went through 2014 WWDC video I found at least some way to affect the appearance of the vibrancy. You can set the background color of the original blur view's contentView like this:

    blurView.contentView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.01];
    

    which will unfortunately also affect the whole blur (by tinting) on which the vibrancy was based. But at least the text is much more readable after that.