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

Crash on appearing with keyboard keyboard; #57

Open
caravaneer404 opened this issue Apr 1, 2015 · 1 comment
Open

Crash on appearing with keyboard keyboard; #57

caravaneer404 opened this issue Apr 1, 2015 · 1 comment

Comments

@caravaneer404
Copy link

I got crash after selection any button of alert if there is keyboard active before [alert show];

This code leads to crash:

- (void)_addAnimation:(CAAnimation *)anim forKey:(NSString *)key {
    UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;

    if ([keyWindow.rootViewController isKindOfClass:[LMEmbeddedViewController class]]) {
        UIView *view = [self delegate];
        CABasicAnimation *basicAnim = (CABasicAnimation *)anim;
        CGFloat modalWidth = 290.0;

        // Hide _UIParallaxDimmingView. It's making the transparent nav controller go dark when animating
        if ([[[view class] description] hasSuffix:@"DimmingView"]) {
            view.hidden = YES;
        }

        // When pushing a view controller, make the one underneath slide out all the way
               ///CRASH HERE!!!!
        if ([key isEqualToString:@"position"] && basicAnim.fromValue != nil) {
            if ([basicAnim.fromValue CGPointValue].x == (modalWidth / 5.0)) {
                basicAnim.fromValue = [NSValue valueWithCGPoint:CGPointMake(-(modalWidth / 2.0), [basicAnim.fromValue CGPointValue].y)];
            }
        }

        if (view.frame.origin.x == (-0.3 * modalWidth)) {
            CGRect frame = view.frame;
            frame.origin.x = -modalWidth;

            view.frame = frame;
        }
    }

    // Note: this calls original Apple implementation of addAnimation:forKey:
    [self _addAnimation:anim forKey:key];
}
@caravaneer404
Copy link
Author

This crash reproduce without keyboard too, i have no idea(

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

1 participant