I am making a image collage app. After collage the image, I'm trying to draw a output image from ViewController and upload to a site.
UIGraphicsBeginImageContextWithOptions(self.viewDFrame.bounds.size, NO, 0.0f);
[self.viewDFrame.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Sometime it can output a completely loaded viewcontroller but mostly it output not completely loaded one like this - with frame only.
This is actual output image and preview image that i wanted to get