#import <QuartzCore/QuartzCore.h>
UIGraphicsBeginImageContext(currentView.bounds.size); //currentView當(dāng)前的view
[currentView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);