Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.6 kB
4
Indexable
Never
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
    [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
    
    if ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
//        self.frontView = [[[NSBundle mainBundle] loadNibNamed:@"ScanARView" owner:self options:nil] firstObject];
//        [self.frontView viewWithTag:11].hidden = YES;
//        self.view = self.frontView;
        //[self changeUItoLandScape];
        self.isLandscape = YES;
        if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
    //        [(UIImageView*)[self.frontView viewWithTag:852] setTransform:CGAffineTransformMakeRotation(M_PI_2)];
    //        [(UIImageView*)[self.frontView viewWithTag:853] setTransform:CGAffineTransformMakeRotation(M_PI_2)];
            self.isLandscapeLeft = YES;
            self.isLandscapeRight = NO;
        }
        else {
            self.isLandscapeLeft = NO;
            self.isLandscapeRight = YES;
        }
    }else
    {
        self.isLandscape = NO;
//        self.frontView = [[[NSBundle mainBundle] loadNibNamed:@"View" owner:self options:nil] firstObject];
//        [self.frontView viewWithTag:11].hidden = YES;
//        self.view = self.frontView;
   }
    dispatch_async(dispatch_get_main_queue(), ^{
        [self updateOrientation];
    });

    //****** Comment *******
    [self->glView setOrientation:toInterfaceOrientation];
}