Skip to content

iOS14崩溃问题修改建议 #48

Description

@jyh1516
if (@available(iOS 13.0, *)) {
    NSEnumerator *frontToBackWindows = [UIApplication.sharedApplication.windows reverseObjectEnumerator];
    for (UIWindow *window in frontToBackWindows) {
        BOOL windowOnMainScreen = window.screen == UIScreen.mainScreen;
        BOOL windowIsVisible = !window.hidden && window.alpha > 0;
        BOOL windowLevelNormal = window.windowLevel == UIWindowLevelNormal;
        if (windowOnMainScreen && windowIsVisible && windowLevelNormal) {
            return [window hitTest:point withEvent:event];
            break;
        }
    }
// return [UIApplication.sharedApplication.keyWindow hitTest:point withEvent:event];
}

这样取最上层window而不是直接拿keyWindow.

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