I'm building a scene with Core Animation which looks similar to the screensaver on the old Apple TV. A continuous stream of images (each a CALayer
) passes by vertically, from the bottom to top. To achieve this, after a layer’s animation ends when it moves out of view, it is repositioned back to the bottom, assigned a new image, and reanimated. This takes place in the animationDidStop
delegate method. However, I’ve noticed that if I take a screenshot when running the app on an iPad, the layers are never repositioned to the bottom, and aren’t seen again. I've isolated the problem, and I'm certain that taking screenshots is causing it. This leads me to think that taking a screenshot has an effect on animation timing. So...
Do one of the following: On an iPad with a Home button: Simultaneously press and then release the top button and the Home button. On other iPad models: Simultaneously press and then release the top button (on the top-right edge of iPad) and either volume button.
You can use Apple Pencil to quickly take a picture of the iPad screen, then mark it up to share with others or use in documents. To capture the screen, swipe up with Apple Pencil from either corner at the bottom of your iPad. To mark up the screenshot, draw with Apple Pencil.
Take screenshot on your Apple iPad Air (2022) iPadOS 15.4Press the Top key. At the same time, press and hold the Top volume key and keep them both pressed to take a screenshot. To edit your screenshot, press the screenshot and follow the instructions on the screen to make the required changes.
You could always try capturing the screenshot programmatically based upon the contents of the view, then save it as a screenshot. I do not know your objects, but this is what I have done before. All of my content for the screenshot is in CaptureView.
CGRect screenRect = [[UIScreen mainScreen] bounds];
UIGraphicsBeginImageContext(CaptureView.frame.size);
CGContextRef ctx = UIGraphicsGetCurrentContext();
[[UIColor clearColor] set];
CGContextFillRect(ctx, screenRect);
[CaptureView.layer renderInContext:ctx];
UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(screenImage, nil, nil, nil);
UIGraphicsEndImageContext();
Is your animation in a stationary UIImageView
? If it is the image view that you want to detect going off of the screen, just use it's frame.origin.y
compared to 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With