I am using gyroscope to handle rotation. For every degree that I rotate iPad, I should redraw the image on the screen to change the height of the mask.
But redrawing stops the gyroscope.
What can I do for this situation?
Edit code added
- (UIImage *)reflectedImage:(UIImageView *)fromImage withHeight:(NSUInteger)height
{
CGImageRef gradientMaskImage = CreateGradientImage(1, height);
CGImageRef masked = CGImageCreateWithMask([fromImage.image CGImage], gradientMaskImage);
CGImageRelease(gradientMaskImage);
UIImage *theImage = [UIImage imageWithCGImage:masked];
return theImage;
}
Gyroscope will give me a value, and I calculate a height for the image. After that I call this function to redraw the mask and image. So if I roll the device, image will blind up or blind down.