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

iOS 7 Animations are a bit choppy #101

Closed
kcharwood opened this issue Sep 13, 2013 · 7 comments
Closed

iOS 7 Animations are a bit choppy #101

kcharwood opened this issue Sep 13, 2013 · 7 comments

Comments

@kcharwood
Copy link
Contributor

I've noticed the performance of the animations in iOS 7 are less than ideal. I'm thinking through a few things on how that can be improved.

Discussion can remain in this thread for now.

@blitzvb
Copy link

blitzvb commented Sep 17, 2013

same here. any fix plan ?

@jessegrosjean
Copy link

They seem much better to me in the case where Shadow is set to true… Different rendering path?

@monk4june
Copy link

Any fix incoming for this?

@jameseunson
Copy link

I get an immediate improvement to performance by setting the shadowRadius to 0 in the updateShadowForCenterView method after centerView.layer.masksToBounds = YES;

-(void)updateShadowForCenterView{
    UIView * centerView = self.centerContainerView;
    if(self.showsShadow){
        centerView.layer.masksToBounds = NO;
        centerView.layer.shadowRadius = MMDrawerDefaultShadowRadius;
        centerView.layer.shadowOpacity = MMDrawerDefaultShadowOpacity;
        centerView.layer.shadowPath = [[UIBezierPath bezierPathWithRect:self.centerContainerView.bounds] CGPath];
    }
    else {
        centerView.layer.shadowPath = [UIBezierPath bezierPathWithRect:CGRectNull].CGPath;
        centerView.layer.masksToBounds = YES;

        // !! Added line
        centerView.layer.shadowRadius = 0;
    }
}

@dexcell
Copy link

dexcell commented Sep 27, 2013

Tried adding line above does improve performance quite a lot

@jessegrosjean
Copy link

Like I said before, performance actual seems much better in case where Shadow is set to true. The reason for that seems to be in updateShadowForCenterView. The default is for showsShadow to be true… so in that method the true path is always called on init. If you then say showsShadow = false… the else block is supposed to reverse things and turn off the shadow. But it's not doing that.

The fix above is a start:

// !! Added line
centerView.layer.shadowRadius = 0;

But I think you also need to add:

centerView.layer.shadowOpacity = 0;

It's only when I do that that the core animation debugger stops marking my centered view as needing offscreen render.

@kcharwood
Copy link
Contributor Author

Fixed in #177

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

6 participants