I have the following code:
if !UIAccessibilityIsReduceTransparencyEnabled()
{
view.backgroundColor = UIColor(patternImage: UIImage(named: "sunset-photo.jpg")!);
let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.light);
let blurEffectView = UIVisualEffectView(effect: blurEffect);
blurEffectView.frame = view.bounds;
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight];
view.addSubview(blurEffectView);
}
else
{
view.backgroundColor = UIColor(red: 110/255, green: 110/255, blue: 110/255, alpha: 1.0);
}
return view;
}
This is fine for regulat UIViews but the table view scrolls. Dragging down then creates a black background and scrolling down shows the image without blur effect. How do I fix this? New to swift by the way.