Pulley: Pulley hangs on iOS 14 Beta 4
After upgrading to iOS 14 Beta 4, even the example projects won’t launch anymore and the CPU is at 100%. I didn’t have time to investigate further so I don’t know if this is a bug from iOS 14 or Pulley. It worked fine until iOS 14 Beta 3.
Anyway, a short term fix I found is to slightly delay the layout code for Pulley with a good old DispatchQueue.main.asyncAfter(deadline: .now() + 0.1)
— which, in my initial testing — seems to resolve the issue. See for an example https://github.com/florianbuerger/Pulley/commit/ea6c287f4153e510ede4baffd0e3c96bb6a000e0
Just wanted to leave that here in case anyone else is running into it.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 9
- Comments: 65 (27 by maintainers)
Commits related to this issue
- a fix for the issue with auto layout feedback loops on ios 14 that supports pannel mode. via issue #390 — committed to 52inc/Pulley by ulmentflam 4 years ago
- Prepareing for release, still waiting on feedback for issues via #390 — committed to 52inc/Pulley by ulmentflam 4 years ago
- Another fix to auto-layout feedback loops via #390 — committed to 52inc/Pulley by ulmentflam 4 years ago
- Xcode 12 ios 14 layout loop fixed https://github.com/52inc/Pulley/issues/390#issuecomment-675691373 — committed to cskaynar/Pulley by ckaynar 3 years ago
Around line 597:
changing this:
to this:
Fixes it. I don’t know this feature or codebase well enough to judge the implications of not running
setNeedsLayout
when old and new values are the same.@funkenstrahlen Thank you! This auto-layout loop is related to when the view is laid out in the
.closed
position. For everyone on this branch or waiting on this issue, I have been debugging this loop and will get thexcode12
branch released as soon as there is a fix.This bug started showing up in 14b4, it’s an auto layout loop caused by calling
view.setNeedsLayout()
inside ofoverride open func viewDidLayoutSubviews()
when setting the value on the variablecurrentDisplayMode
. For now I’ve removed theview.setNeedsLayout()
from the variable setter, but it might cause unexpected behavior when changing the drawer display mode after it is drawn.My guess is that this bug is being caused by a faster UI drawing brought by the latest beta, which causes a new re-draw while the call to
viewDidLayoutSubviews()
hasn’t finished yet, you can run your projects with the launch argument-UIViewLayoutFeedbackLoopDebuggingThreshold 100
to better debug this issue.@pmacro I am planning to hold off until there is more clarity on the reported issues before getting this branch out specifically. I would like to get more clarity on @sohail-niazi’s and @funkenstrahlen’s issues before I release (as on the sample project I have not been able to replicate either of their issues on this branch). I want to get a fix for this issue out as soon as possible, as soon as I have clarity on these existing issues. That leads me to my next question for @sohail-niazi, Can you replicate this issue in the demo project for me?
@150vb I just pushed a new fix for your issue to the
xcode12
branch and would love for you to test it before I release it.@ulmentflam also experienced the issue. 100% CPU, loop on layoutSubview… Just upgraded to master and seems to be working. Thanks for the support. Would have been virtually impossible for me to fix
@ulmentflam Thanks for new release. But The issue persists. Auto-layout is looping, it is looping for collapsed position so check of .closed is not working. drawerMaskingPath() is getting called from 3 different locations : 1 - maskBackgroundDimmingView() 2 - maskDrawerVisualEffectView() 3 - viewDidLayoutSubviews() on line 862
We have a official fix for the iOS 14 and Xcode 12 issues here. We can address any new issue related to the above fixes on the
xcode12
branch. However to get something stable out sooner rather then later for iOS 14, the fixes in thexcode12
branch have been released. Pulley 2.8.2Hi @ulmentflam, I fully understand all the moving parts here, and that this may be an unreasonable question! But given the announcement that iOS 14 will be released tomorrow, could you please share your thoughts on the timing of this fix? Do you plan to have a compatible release ASAP, or do you plan to hold off until there is more clarity on reported issues, such as @sohail-niazi’s? That information would help me, and hopefully others, who plan to release iOS 14 updates for their apps ASAP. Thank you!
@ulmentflam Thanks for the replies, I posted the logs here, I thought these would be useful. I was able to reappearance it via PullyDemo.
@pmacro The
xcode12
branch that everyone is reporting as working is equal to the2.8.3
release as of now. As new issues come in related to Xcode 12 it will be the bugfix branch for continued development@ulmentflam I just wanted to confirm: is the
xcode12
branch that everyone seems to be reporting as working, equal to the2.8.3
release? Or is there something different in there that you’re planning for a subsequent release?And as an aside, thanks for all your work on this release, especially given the short time scale Apple gave us all to have solid iOS 14 versions of our libraries. 👏
@ulmentflam looking into it.
Gotcha, looking into it now
I just pushed a theoretical fix to the
xcode12
branch. If anyone continues to run into issues let me know ASAP, otherwise I will get a release out as soon as there is confirmation that this update is working.@sohail-niazi That’s great! It looks like there is still an auto-layout feedback loop when the initial drawer position is set. I am looking into it now, thanks for the feedback!
@ulmentflam We can reproduce this issue in two of our apps with latest stable version. After applying the
xcode12
branch of this repo our views work as expected and we could so far not detect any other side effects.Unfortunately I will not be able to provide further input to this issue. I decided to go with a completely different approach and use system default modal views instead of Pulley in my app as I am trying to get the app compatible with macOS. This will be more easy with default system components in my case.
@ulmentflam Ah, got it 😄 I’ll see if I can test the
xcode12
branch this week. Not sure if we need anything else from my fork of Pulley, it has been a while since I looked at that part of the app.