Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS8+ orientation issues #24

Closed
tbrannam opened this issue Feb 17, 2015 · 3 comments
Closed

iOS8+ orientation issues #24

tbrannam opened this issue Feb 17, 2015 · 3 comments

Comments

@tbrannam
Copy link
Contributor

in the current SimpleSample example, the implementation used the methods

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation;

both of these are marked as deprecated in iOS8. InterfaCSS seems to depend on a trigger to restyle the views after rotation occurs (example shows the call being made in didRotateFromInterfaceOrienation)

Is there a suggested pattern to follow to ensure that styles are kept up to date in iOS8 or higher targets?

@tbrannam
Copy link
Contributor Author

This appears to be a workable solution

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator {
    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
        [[InterfaCSS interfaCSS] applyStyling:self.view includeSubViews:YES force:YES];
    } completion:NULL];

    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}

@tolo
Copy link
Owner

tolo commented Mar 13, 2015

The rotation methods are actually only used for logging of active style declaration in the sample code - InterfaCSS itself actually doesn't depend on those rotation methods. An update of the sample code is underway.

@tolo tolo closed this as completed in 7268477 Mar 13, 2015
@tbrannam
Copy link
Contributor Author

So I may have a bug in my code, but when I comment out the 'rotation' call in my viewcontroller - I can end up with styles that get mixed up if they are in portrait or landscape ( I styled a background color of a label in a collectionviewcell as red when in landscape). I thought this was a required call - since it fixed me in the short term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants