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

Tapping Drop on iOS 17, built with Xcode 15, triggers EXC_BAD_ACCESS #45

Closed
yumemi-ajike opened this issue Sep 11, 2023 · 2 comments · Fixed by #48
Closed

Tapping Drop on iOS 17, built with Xcode 15, triggers EXC_BAD_ACCESS #45

yumemi-ajike opened this issue Sep 11, 2023 · 2 comments · Fixed by #48

Comments

@yumemi-ajike
Copy link

yumemi-ajike commented Sep 11, 2023

Hi,

EXC_BAD_ACCESS occurs when tapping 'Drop' in the UIKitExample app built with Xcode 15 RC, when running on iOS 17.

It seems to be accessing WindowController.preferredStatusBarStyle in an infinite loop.
Drop.action does not be firing.
This does not occur on iOS 16.

Drops_Loop.mov

Thanks for the great framework!

@yumemi-ajike
Copy link
Author

yumemi-ajike commented Sep 12, 2023

I found the addition of a workaround for a UIKit bug in version 1.3.0.
6f0cd30
Removing these lines can avoid the problem on iOS 17.

However, I don't know which version of iOS the workaround was implemented for, so I can't create an 'if' statement.

@yumemi-ajike yumemi-ajike changed the title Tapping Drop on iOS 17, built with Xcode 15 beta 8, triggers EXC_BAD_ACCESS Tapping Drop on iOS 17, built with Xcode 15, triggers EXC_BAD_ACCESS Sep 13, 2023
@mohakapt
Copy link

I just debugged it, looks like this line is returning the WindowViewController itself:

    let topViewController = windowScene?.windows.first(where: \.isKeyWindow)?.rootViewController?.top

    let check = topViewController == self // true

which is causing an infinite loop (StackOverflow) when trying to access the preferredStatusBarStyle on it:

    return topViewController?.preferredStatusBarStyle
      ?? windowScene?.statusBarManager?.statusBarStyle
      ?? .default

I wonder what's the goal of this code 🤔.
Judging form the issue linked in the code, it looks like the color of the status bar changes when the Drop appears. If that's the case I guess we should get the preferredStatusBarStyle from the view controller behind the one on top.

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

Successfully merging a pull request may close this issue.

2 participants