IOS screenshot code and ios screenshot code
-(UIImage *) getScreenPhoto {
CGFloat scale = [UIScreen mainScreen]. scale;
NSMutableArray * images = [NSMutableArray array];
CGSize contentSize = self. view. size;
CGSize imageSize = CGSizeMake (contentSize. width * scale, contentSize. height * scale );
Uigraphicsbeginimagecontextwitexceptions (self. view. size, NO, 0.0 );
[Self. view. layer renderInContext: UIGraphicsGetCurrentContext ()];
UIImage * image = UIGraphicsGetImageFromCurrentImageContext ();
UIGraphicsEndImageContext ();
[Images addObject: image];
UIGraphicsBeginImageContext (imageSize );
[Images enumerateObjectsUsingBlock: ^ (UIImage * image, NSUInteger idx, BOOL * stop ){
[Image drawInRect: CGRectMake (0, scale * EJScreenH * idx, EJScreenW * scale, EJScreenH * scale)];
}];
UIImage * fullImage = UIGraphicsGetImageFromCurrentImageContext ();
UIGraphicsEndImageContext ();
Return fullImage;
}