您几乎拥有它,但是问题如上面的注释所述。如果要捕获
SKScene内容,请尝试以下类似方法:
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, scale);[self.view drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();
解决方案是基本上改用新方法
drawViewHierarchyInRect:afterScreenUpdates,这是我们目前拥有的最好方法。请注意,这并不是完全快速的,因此实时执行此操作并不容易。



