I have developed the application in which i want to set the background color of UIView which is already set on UIViewController.The code is below,
@implementatio
Swift 3
UIGraphicsBeginImageContextWithOptions(size, true, UIScreen.main.scale) let context = UIGraphicsGetCurrentContext() context?.setFillColor(UIColor.green.cgColor) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image