I'd like to be able to dismiss my modals by sliding them down. To do, I'd like to be able to see the previous view controller behind the current one as I drag it down.
To do so, I encapsulated my view in a scroll view and I tried to print an image of the previous VC behind so as I slide down I can see it. Unfortunately it does work, all I can see is a black screen.
I used this code to do this:
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.navigationController.viewControllers[ self.navigationController.viewControllers.count-1].view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.view.backgroundColor = [UIColor colorWithPatternImage:viewImage];
Does anyone has an idea on how to do this?
Thanks a lot