I have a UITableViewController to which I have successfully applied gradient backgrounds in the past by sending the newly added subview back:
//performed on viewDidLoad UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1.5*280, 1.5*SCREEN_HEIGHT)]; bgView.backgroundColor = [UIColor yellowColor]; CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = bgView.bounds; gradient.startPoint = CGPointMake(0, 0); gradient.endPoint = CGPointMake(1, 1); UIColor *topColor = UIColorFromRGB(0x229f80); UIColor *bottomColor = UIColorFromRGB(0x621ad9); gradient.colors = [NSArray arrayWithObjects:(id)[topColor CGColor], (id)[bottomColor CGColor], nil]; [bgView.layer insertSublayer:gradient atIndex:0]; [self.view addSubview:bgView]; [self.view sendSubviewToBack:bgView]; bgView = nil;
However, this no longer works in iOS 11, and bgView is actually placed on top of all cells.

Does anyone know how I can fix this? Or maybe I did it wrong all the time?
source share