5
Mi piacerebbe catturare rapidamente uno screenshot per fare un video di immagini. Attualmente sto usando il seguente codice, tuttavia è leggermente in ritardo. C'è un metodo migliore per fare screenshot che saranno più veloci?ritardo screenshot iOS
CGSize imageSize = [[UIScreen mainScreen] bounds].size;
if (NULL != UIGraphicsBeginImageContextWithOptions)
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 1);
else
UIGraphicsBeginImageContext(imageSize);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *imageName = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();