I am trying to get screen capture working on my iOS SpriteKit game using this code (by Aroth)
Basically I need to replace the SKView of my UIViewController with my own ScreenCaptureView (see the link). I changed the ScreenCaptureView in the example to derive from SKView instead of UIView.
I override loadView function in my game UIViewController class:
- (void)loadView
{
ScreenCaptureView *newView = [[ScreenCaptureView alloc] init];
newView.frame = CGRectMake(0, 0, 568, 320);//hard code for now
newView.clipsToBounds = NO;
self.view = newView;
[newView setNeedsDisplay];
NSLog(@"loadView %x", (int)newView);
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"viewDidLoad view %x %f x %f", (int)self.view ,self.view.frame.size.width, self.view.frame.size.height);
But its not working. The drawRect in ScreenCaptureView never gets called.
Any help is really appreciated.