Skip to content

Instantly share code, notes, and snippets.

@TheCodeEngine
Last active April 9, 2018 10:51
Show Gist options
  • Save TheCodeEngine/3776309 to your computer and use it in GitHub Desktop.
Save TheCodeEngine/3776309 to your computer and use it in GitHub Desktop.
Auto Rotate
- (BOOL)shouldAutorotate {
return YES;
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
// Move the Labels into place
switch ([UIDevice currentDevice].orientation) {
case UIDeviceOrientationLandscapeLeft:
case UIDeviceOrientationLandscapeRight:
{
clock.frame = [TCEClock calcPositionMiddlefromBounds:self.view.bounds clockwidth:250.f];
break;
}
case UIDeviceOrientationPortrait:
case UIDeviceOrientationFaceDown:
{
clock.frame = [TCEClock calcPositionMiddlefromBounds:self.view.bounds clockwidth:250.f];
break;
}
default:
break;
}
}
@cpez1992
Copy link

cpez1992 commented Apr 9, 2018

666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment