Skip to content

Crash on appearing with keyboard keyboard; #57

@caravaneer404

Description

@caravaneer404

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];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions