I understand that I can add UIVisualEffects programmatically, conditionally executed if the class exists, for example.
if([UIVisualEffectView class]){ UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; [blurEffectView setFrame:self.backgroundBlurView.bounds]; [self.backgroundBlurView addSubview:blurEffectView]; UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:blurEffect]; UIVisualEffectView *vibrancyEffectView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect]; [vibrancyEffectView setFrame:self.backgroundVibrancyView.bounds]; [[vibrancyEffectView contentView] addSubview:self.backgroundVibrancyView]; [[blurEffectView contentView] addSubview:vibrancyEffectView]; vibrancyEffectView.center = blurEffectView.center; }
But is there a way to add visual effects to the storyboard, then conditionally delete them to be compatible with iOS7? I tried this but keep getting this error: Class is not available UIVisualEffectView prior to iOS8
source share