iOS Set View Background Fill background Image of a UIView


Example

Objective-C

 UIGraphicsBeginImageContext(self.view.frame.size);
 [[UIImage imageNamed:@"image.png"] drawInRect:self.view.bounds];
 UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
 UIGraphicsEndImageContext();     
 self.view.backgroundColor = [UIColor colorWithPatternImage:image];