代码截屏
UIGraphicsBeginImageContext(view.frame.size);
对哪个视图截图给定大小的图片
[ view.layer renderInContext:UIGraphicsGetCurrentContext()];
获取截图的图片对象
UIImage * p_w_picpath = UIGraphicsGetImageFromCurrentImageContext();
结束绘制图片
UIGraphicsEndImageContext();
保存到相册
UIImageWriteToSavedPhotosAlbum(p_w_picpath, nil, nil, nil);