I have a UITableViewCell that has an UIView (gradientView) where I want to apply the gradient. This cell has AutoLayout, and so I want to update the gradient frame when the gradientView frame changes.
I have tried the following, but none of them worked:
-(void)layoutSubviews{
[super layoutSubviews];
self.gradient.frame = self.gradientView.bounds;
}
-(void)updateConstraints{
[super updateConstraints];
self.gradient.frame = self.gradientView.bounds;
}
-(void)updateConstraintsIfNeeded{
[super updateConstraintsIfNeeded];
self.gradient.frame = self.gradientView.bounds;
}
also I can't use this inside the cell:
- (void)viewDidLayoutSubviews{}