All posts tagged “code”

quick way how to deal with the new rotation paradigm in iOS 8

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
    if (size.width > size.height) {
        [self.view removeConstraints:self.portraitConstraints];
        [self.view addConstraints:self.landscapeConstraints];
    } else {
        [self.view removeConstraints:self.landscapeConstraints];
        [self.view addConstraints:self.portraitConstraints];
    }
}