Get small "preview" of view controller
I want to be able to dynamically get a "preview" of view controllers in my navigation stack if possible.
So if I know the class of the view controller (or indeed have the object) is there anyway to get a "screenshot" or a "previe开发者_运维技巧w" of it? I don't mind if its a uiview or a flat image. :)
Thanks
Tom
#import <QuartzCore/QuartzCore.h>
and
UIGraphicsBeginImageContext(viewcontroller.view.bounds.size);
[viewcontroller.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *preview = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
精彩评论