This is not advisable to set UIView
background colour (to set an image) like this, instead add an UIImageView
as subview of UIView
and then assign image it to it. This will be same look like you've setting a background.
However, here's the solution for this,
UIGraphicsBeginImageContext(self.view.frame.size);
[[UIImage imageNamed:@"image.png"] drawInRect:self.view.bounds];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.view.backgroundColor = [UIColor colorWithPatternImage:image];
Straight from this answer