截取全屏

//全屏截图

+ (UIImage *)shotScreen{

   UIWindow *window = [UIApplication sharedApplication].keyWindow;

   UIGraphicsBeginImageContext(window.bounds.size);

   [window.layer renderInContext:UIGraphicsGetCurrentContext()];

   UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

   UIGraphicsEndImageContext();

   return image;

}

你可能感兴趣的:(截取全屏)