SwiftUIBackports icon indicating copy to clipboard operation
SwiftUIBackports copied to clipboard

Infinite loop in UIView parentController property on iOS 14.0-14.4

Open anivaros opened this issue 1 year ago • 8 comments

General Information

See attached project

  • Project version: 1.6.3

  • Platform/OS version: iOS 14.0-14.4

  • IDE version: Xcode 13

  • Devices:

  • Any related GitHub issues:

Describe the bug

Uninited tab body causes infinite loop in UIView parentController property

Steps to reproduce

  1. Run attached project on iOS 14.0-14.4
  2. Tap "Show modal" on tab A
  3. Select TextField

Expected behavior

No infinite loop in OwningController.swift

Stack trace, compiler error, code snippets

Archive.zip

Additional context

If tab B were opened before Modal, all works fine.

anivaros avatar Sep 08 '22 09:09 anivaros

Thank you for raising, will investigate 👍🏻

shaps80 avatar Sep 08 '22 10:09 shaps80

This issue could occur in other scenarios, but this is simplest way to reproduce

anivaros avatar Sep 08 '22 10:09 anivaros

Just ran into this as well with a TabView. Thank you for looking into it.

ChristopherCarranza avatar Sep 10 '22 21:09 ChristopherCarranza

I'm having trouble getting this issue to show up tbh. I've used your project and explored this myself but I cannot reproduce. Are you able to reproduce 100% of the time?

You mention above that the issue occurs in Xcode 13, but you saved the project using Xcode 14 beta, so I fixed that and tried in 13 but still no joy.

shaps80 avatar Sep 12 '22 07:09 shaps80

Yes, 100%. Same problem on Xcode 14, no difference. Which simulator did you use? Just checked on Xcode 14 RC + iPhone 11 14.1, same problem. Screenshot 2022-09-12 at 11 23 25

anivaros avatar Sep 12 '22 08:09 anivaros

Ok I'll try that, odd that its not 100% of the time for me. Thanks for checking, will try this now.

shaps80 avatar Sep 12 '22 08:09 shaps80

I've got same problem on latest iOS with .backport.scrollDisabled(true) on code like this:

ScrollView {
    LazyVGrid(columns: [GridItem(.adaptive(minimum: 140))]) {
        rows
    }
}
.backport.scrollDisabled(true)

But I can't achieve this on minimal reproducible example :(

anivaros avatar Sep 12 '22 08:09 anivaros

Yeah I'm guessing its an issue in the view controller lookup code, I think I have an idea for fixing it overall.

shaps80 avatar Sep 12 '22 08:09 shaps80

@anivaros I should have a new release out today/tomorrow that I think resolves this issue completely.

shaps80 avatar Sep 29 '22 09:09 shaps80

Great news! 🔥

anivaros avatar Sep 29 '22 09:09 anivaros

FYI I’ve fallen sick today, will get to this very soon, just need a couple days 👍🏻

shaps80 avatar Sep 30 '22 17:09 shaps80

Oh! Get well soon!

anivaros avatar Sep 30 '22 18:09 anivaros

@anivaros the fix should now be in main – if you could check it out and confirm it resolves the issues you've been seeing that'd be great, if so, I can merge in just that change and make a release – thanks!

shaps80 avatar Oct 03 '22 14:10 shaps80

.@shaps80 I've checked, now all ok. Also checked issue with .backport.scrollDisabled(true) and LazyVGrid. Looks like now all works as expected 🎉 Thank you!!

anivaros avatar Oct 03 '22 14:10 anivaros

Amazing! Glad to hear. I'll get this in shortly :)

shaps80 avatar Oct 03 '22 14:10 shaps80