IPad - CGAffineTransformMakeRotation - Saving Rotation

I have a screen with a title (HUD) that I'm trying to rotate correctly with a view. I created a function orientationWillChangethat should rotate the view, and it works fine, it just takes a bit more programming on the side of the view controller that implements it.

My main problem is that it rotates when it closes. It performs some other transformations when it closes (shrinks / disappears, so that it disappears), but it seems to turn it back to "normal".

I don’t want to rotate the view another 90 degrees, I just want to make sure that it remains in the rotation. How to do it?

My closing function is as follows:

- (void)close {
    _windowIsShowing = NO;
    [UIView animateWithDuration:0.125 animations:^{
        hudView.transform = CGAffineTransformMakeRotation(rotationDegrees * M_PI / 180);
        hudView.transform = CGAffineTransformMakeScale(1.1, 1.1);
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.15 animations:^{
            hudView.transform = CGAffineTransformMakeScale(0.4, 0.4);
            hudView.alpha = 0.0;
            backgroundColorView.alpha = 0.0;
        } completion:^(BOOL finished) {
            [hudWindow resignKeyWindow];
            [self release];
        }];
    }];
}

(fyi CloudApp HUD)

+3

All Articles