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

Most upvoted comments

Around line 597:

changing this:

    public fileprivate(set) var currentDisplayMode: PulleyDisplayMode = .automatic {
        didSet {
            if self.isViewLoaded
            {
                self.view.setNeedsLayout()
            }

            if oldValue != currentDisplayMode
            {

to this:

    public fileprivate(set) var currentDisplayMode: PulleyDisplayMode = .automatic {
        didSet {
            if oldValue != currentDisplayMode
            {
                if self.isViewLoaded
                {
                    self.view.setNeedsLayout()
                }

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 the xcode12 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 of override open func viewDidLayoutSubviews() when setting the value on the variable currentDisplayMode. For now I’ve removed the view.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 the xcode12 branch have been released. Pulley 2.8.2

Hi @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.

2020-09-23 13:12:07.161330+0800 PulleyDemo[18818:574117] [LayoutLoop] Degenerate layout! Layout feedback loop detected in subtree of <UIView: 0x7f95d20056e0; frame = (0 0; 375 812); wants auto layout; hosts layout engine; tAMIC = YES; >. 

Top-level view = <UIView: 0x7f95d20056e0; frame = (0 0; 375 812); wants auto layout; hosts layout engine; tAMIC = YES; >

Views caught in loop: 
3 <UIView: 0x7f95d20056e0; frame = (0 0; 375 812); wants auto layout; hosts layout engine; tAMIC = YES; >
|   <UIView: 0x7f95d06075a0; frame = (0 0; 375 812); wants auto layout; tAMIC = NO; >
|   |   <UIView: 0x7f95d220c2d0; frame = (0 0; 375 812); wants auto layout; tAMIC = NO; >
|   |   |   <MKMapView: 0x7f95d4817600; frame = (0 0; 375 812); wants auto layout; tAMIC = NO; >
|   |   |   |   <_MKMapContentView: 0x7f95d0606ab0; frame = (0 0; 375 812); >
|   |   |   |   |   <MKBasicMapView: 0x7f95d06178b0; frame = (0 0; 375 812); >
|   |   |   |   |   |   <_MKMapLayerHostingView: 0x7f95d0617c40; frame = (0 0; 375 812); >
|   |   |   |   |   <MKScrollContainerView: 0x7f95d061b640; frame = (-5277.33 -1968.67; 6192.75 6192.75); >
|   |   |   |   |   <MKAnnotationContainerView: 0x7f95d0617db0; frame = (0 0; 375 812); >
|   |   |   |   <MKAppleLogoImageView: 0x7f95d2125ad0; baseClass = UIImageView; frame = (10 752; 90 19); >
|   |   |   |   <MKAttributionLabel: 0x7f95d070b8c0; frame = (336.426 757.26; 28.5742 10.7402); >
|   |   |   <UIVisualEffectView: 0x7f95d220dc30; frame = (0 0; 375 44); wants auto layout; tAMIC = NO; >
|   |   |   |   <_UIVisualEffectBackdropView: 0x7f95d220e1a0; frame = (0 0; 375 44); >
|   |   |   |   <_UIVisualEffectSubview: 0x7f95d220f0b0; frame = (0 0; 375 44); >
|   |   |   |   <_UIVisualEffectContentView: 0x7f95d220de00; frame = (0 0; 375 44); >
|   |   |   <UIView: 0x7f95d060df90; frame = (323 52; 44 74); wants auto layout; tAMIC = NO; >
|   |   |   |   <UIButton: 0x7f95d0610550; frame = (11 10; 22 22); wants auto layout; tAMIC = NO; >
|   |   |   |   |   <UIImageView: 0x7f95d0610a30; frame = (-39 -39; 100 100); >
|   |   |   |   |   <UIImageView: 0x7f95d210c7b0; frame = (0 0; 22 22); >
|   |   |   |   <UIButton: 0x7f95d270a900; frame = (11 42; 22 22); wants auto layout; tAMIC = NO; >
|   |   |   |   |   <UIImageView: 0x7f95d212f490; frame = (0 0; 22 22); >
|   |   |   <UILabel: 0x7f95d220cc40; frame = (325 677; 42 25); text = '78°'; wants auto layout; tAMIC = NO; >
|   <UIView: 0x7f95d0608cd0; frame = (0 -76; 375 2187); >
|   1 <Pulley.PulleyPassthroughScrollView: 0x7f95d0813200; baseClass = UIScrollView; frame = (0 64; 375 748); wants auto layout; tAMIC = YES; >
|   |   <UIView: 0x7f95d0607c80; frame = (0 646; 375 768); >
|   |   <UIVisualEffectView: 0x7f95d0608e40; frame = (0 646; 375 768); >
|   |   |   <_UIVisualEffectBackdropView: 0x7f95d0609210; frame = (0 0; 375 768); >
|   |   <UIView: 0x7f95d0607b10; frame = (0 646; 375 768); wants auto layout; tAMIC = YES; >
|   |   |   2 <UIView: 0x7f95d07144c0; frame = (0 0; 375 768); wants auto layout; tAMIC = NO; >
|   |   |   |   <UIView: 0x7f95d0714d40; frame = (0 0; 375 778); wants auto layout; tAMIC = NO; >
|   |   |   |   |   <UIView: 0x7f95d0713870; frame = (0 0; 375 102); wants auto layout; tAMIC = NO; >
|   |   |   |   |   |   <UISearchBar: 0x7f95d22132f0; frame = (0 6; 375 56); text = ''; wants auto layout; tAMIC = NO; >
|   |   |   |   |   |   |   <UIView: 0x7f95d2213fb0; frame = (0 0; 375 56); >
|   |   |   |   |   |   |   |   <_UISearchBarScopeContainerView: 0x7f95d0713700; frame = (0 56; 375 0); >
|   |   |   |   |   |   |   |   |   <_UISearchBarScopeBarBackground: 0x7f95d0713c70; frame = (0 0; 375 0); >
|   |   |   |   |   |   |   |   |   <UISegmentedControl: 0x7f95d07132d0; frame = (188 7; 0 32); >
|   |   |   |   |   |   |   |   <UISearchBarBackground: 0x7f95d2214120; frame = (0 0; 375 56); >
|   |   |   |   |   |   |   |   |   <_UIBackdropView: 0x7f95d07148c0; frame = (0 0; 375 56); >
|   |   |   |   |   |   |   |   |   |   <_UIBackdropEffectView: 0x7f95d07152b0; frame = (0 0; 375 56); >
|   |   |   |   |   |   |   |   |   |   <UIView: 0x7f95d061b3b0; frame = (0 0; 375 56); >
|   |   |   |   |   |   |   |   <_UISearchBarSearchContainerView: 0x7f95d2214740; frame = (0 0; 375 56); >
|   |   |   |   |   |   |   |   |   <UISearchBarTextField: 0x7f95d303a600; frame = (8 10; 359 36); text = ''; >
|   |   |   |   |   |   |   |   |   |   <_UISearchBarSearchFieldBackgroundView: 0x7f95d070d5d0; frame = (0 0; 359 36); >
|   |   |   |   |   |   |   |   |   |   |   <_UISearchBarSearchFieldBackgroundView: 0x7f95d070d980; frame = (0 0; 359 36); >
|   |   |   |   |   |   |   |   |   |   <UIImageView: 0x7f95d210ceb0; frame = (6 8.66667; 19.6667 18); >
|   |   |   |   |   |   |   |   |   |   <UISearchBarTextFieldLabel: 0x7f95d0714040; frame = (29.6667 8; 199.667 20.3333); text = 'Where do you want to go?'; >
|   |   |   |   |   |   |   |   |   |   <_UISearchTextFieldCanvasView: 0x7f95d2215700; frame = (29.6667 2; 322.333 32); >
|   |   |   |   |   |   |   |   |   |   |   <UITextSelectionView: 0x7f95d500b3a0; frame = (0 0; 0 0); >
|   |   |   |   |   |   <UIView: 0x7f95d0713e40; frame = (0 101.667; 375 0.333333); wants auto layout; tAMIC = NO; >
|   |   |   |   |   <UITableView: 0x7f95d1825800; frame = (0 102; 375 646); wants auto layout; tAMIC = NO; >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d2145aa0; frame = (0 567; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d2145e70; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d2146000; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d21462a0; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2146540; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d21475c0; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d2143df0; frame = (0 486; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d21441c0; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d2144350; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d21445f0; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2144890; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2145910; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d2142250; frame = (0 405; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d2142620; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d21427b0; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d2142a50; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2142cf0; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2143c60; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d21407a0; frame = (0 324; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d2140b70; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d2140d00; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d2140fa0; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2141240; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d21420c0; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d213ec10; frame = (0 243; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d213efe0; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d213f170; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d213f410; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d213f6b0; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2140610; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d213cda0; frame = (0 162; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d213d170; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d213d300; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d213d5a0; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d213d840; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d213e720; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d213b1c0; frame = (0 81; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d213b590; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d213b720; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d213b9c0; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d213bc60; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d213cc10; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <UITableViewCell: 0x7f95d2135990; frame = (0 0; 375 81); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   <UITableViewCellContentView: 0x7f95d2135f60; frame = (0 0; 375 81); >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d21362f0; frame = (16 15.3333; 200.333 24); text = 'Neighborhood Market'; >
|   |   |   |   |   |   |   |   <UITableViewLabel: 0x7f95d2136ce0; frame = (16 43; 58.3333 20.3333); text = 'Subtitle'; >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d2136f80; frame = (15 80; 360 1); >
|   |   |   |   |   |   |   <_UITableViewCellSeparatorView: 0x7f95d213af10; frame = (16 80.6667; 359 0.333333); >
|   |   |   |   |   |   <_UIScrollViewScrollIndicator: 0x7f95d061f430; frame = (369 235.5; 3 7); >
|   |   |   |   |   |   |   <UIView: 0x7f95d061f5c0; frame = (0 0; 3 7); >
|   |   |   |   |   |   <_UIScrollViewScrollIndicator: 0x7f95d061f130; frame = (365 640; 7 3); >
|   |   |   |   |   |   |   <UIView: 0x7f95d061f2c0; frame = (0 0; 7 3); >
|   |   |   |   <UIView: 0x7f95d0713500; frame = (169.667 6; 36 5); wants auto layout; tAMIC = NO; >
|   |   |   |   <UIView: 0x7f95d20124a0; frame = (0 748; 375 0.666667); wants auto layout; tAMIC = NO; >

Views receiving layout in order: (
	<Pulley.PulleyPassthroughScrollView: 0x7f95d0813200; baseClass = UIScrollView; frame = (0 64; 375 748); wants auto layout; tAMIC = YES; >
	<UIView: 0x7f95d07144c0; frame = (0 0; 375 768); wants auto layout; tAMIC = NO; >
	<UIView: 0x7f95d20056e0; frame = (0 0; 375 812); wants auto layout; hosts layout engine; tAMIC = YES; >
)


*** Views With Geometry Changes ***
Geometry change records for <UIView: 0x7f95d0607b10; f={{0, 646}, {375, 768}} >:
(
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >"
)
Geometry change records for <UIView: 0x7f95d0608cd0; f={{0, -76}, {375, 2187}} >:
(
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 0; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, -76; 375, 2187); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >"
)
Geometry change records for <Pulley.PulleyPassthroughScrollView: 0x7f95d0813200; f={{0, 64}, {375, 748}} baseClass = UIScrollView; >:
(
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 64; 375, 748); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >"
)
Geometry change records for <UIView: 0x7f95d0607c80; f={{0, 646}, {375, 768}} >:
(
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >"
)
Geometry change records for <UIVisualEffectView: 0x7f95d0608e40; f={{0, 646}, {375, 768}} >:
(
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >",
    "<frame = (0, 646; 375, 768); in -viewDidLayoutSubviews of <Pulley.PulleyViewController: 0x7f95d0812800> with <UIView: 0x7f95d20056e0; f={{0, 0}, {375, 812}} >; >"
)

*** Call stacks where -setNeedsLayout is sent to the top-level view ***
{(
    (
	0   UIKitCore                           0x000000011267f694 -[_UIViewLayoutFeedbackLoopDebugger _recordSetNeedsLayoutToLayerOfView:] + 556
	1   UIKitCore                           0x0000000112625d58 -[UIView(Hierarchy) setNeedsLayout] + 389
	2   Pulley                              0x00000001028d7b75 $s6Pulley0A14ViewControllerC13shadowOpacitySfvW + 517
	3   Pulley                              0x00000001028d7968 $s6Pulley0A14ViewControllerC13shadowOpacitySfvs + 136
	4   PulleyDemo                          0x0000000102029494 $s10PulleyDemo27DrawerContentViewControllerC23drawerPositionDidChange0G014bottomSafeAreay0A00aeF0C_12CoreGraphics7CGFloatVtF + 4356
	5   PulleyDemo                          0x000000010202952e $s10PulleyDemo27DrawerContentViewControllerC23drawerPositionDidChange0G014bottomSafeAreay0A00aeF0C_12CoreGraphics7CGFloatVtFTo + 78
	6   Pulley                              0x00000001028fe213 $sTa.64 + 35
	7   Pulley                              0x00000001028f1b9c $s6Pulley0A14ViewControllerC12CoreGraphics7CGFloatVIegyy_AcFIeggy_TR + 12
	8   Pulley                              0x00000001028f0422 $s6Pulley0A14ViewControllerC17setDrawerPosition8position8animated10completionyAA0aF0C_SbySbcSgtF + 6002
	9   Pulley                              0x00000001028ea38c $s6Pulley0A14ViewControllerC21viewDidLayoutSubviewsyyF + 25532
	10  Pulley                              0x00000001028ea4bb $s6Pulley0A14ViewControllerC21viewDidLayoutSubviewsyyFTo + 43
	11  UIKitCore                           0x000000011263abcb -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 3383
	12  QuartzCore                          0x0000000103ffbd87 -[CALayer layoutSublayers] + 258
	13  QuartzCore                          0x0000000104002239 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 575
	14  QuartzCore                          0x000000010400df91 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65
	15  QuartzCore                          0x0000000103f4e078 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 496
	16  QuartzCore                          0x0000000103f84e13 _ZN2CA11Transaction6commitEv + 783
	17  UIKitCore                           0x00000001120fb27a __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81
	18  CoreFoundation                      0x0000000102fdb5db __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
	19  CoreFoundation                      0x0000000102fda9ef __CFRunLoopDoBlocks + 434
	20  CoreFoundation                      0x0000000102fd540c __CFRunLoopRun + 899
	21  CoreFoundation                      0x0000000102fd4b9e CFRunLoopRunSpecific + 567
	22  GraphicsServices                    0x000000011664cdb3 GSEventRunModal + 139
	23  UIKitCore                           0x00000001120ddaf3 -[UIApplication _run] + 912
	24  UIKitCore                           0x00000001120e2a04 UIApplicationMain + 101
	25  PulleyDemo                          0x000000010202b3eb main + 75
	26  libdyld.dylib                       0x000000010daaf415 start + 1
	27  ???                                 0x0000000000000003 0x0 + 3
)
)}
2020-09-23 13:12:07.169428+0800 PulleyDemo[18818:574117] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Degenerate layout! Layout feedback loop detected in subtree of <UIView: 0x7f95d20056e0; frame = (0 0; 375 812); wants auto layout; hosts layout engine; tAMIC = YES; >. More info may be available in the log for com.apple.UIKit.LayoutLoop'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010306d126 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x0000000102efdf78 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010306cdc7 -[NSException init] + 0
	3   UIKitCore                           0x000000011267fdfc -[_UIViewLayoutFeedbackLoopDebugger dumpInfoWithInfoCollectionSuccess:] + 507
	4   UIKitCore                           0x000000011267e97b -[_UIViewLayoutFeedbackLoopDebugger willSendLayoutSubviewsToView:] + 143
	5   UIKitCore                           0x000000011263a943 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2735
	6   QuartzCore                          0x0000000103ffbd87 -[CALayer layoutSublayers] + 258
	7   QuartzCore                          0x0000000104002239 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 575
	8   QuartzCore                          0x000000010400df91 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65
	9   QuartzCore                          0x0000000103f4e078 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 496
	10  QuartzCore                          0x0000000103f84e13 _ZN2CA11Transaction6commitEv + 783
	11  UIKitCore                           0x00000001120fb27a __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81
	12  CoreFoundation                      0x0000000102fdb5db __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
	13  CoreFoundation                      0x0000000102fda9ef __CFRunLoopDoBlocks + 434
	14  CoreFoundation                      0x0000000102fd540c __CFRunLoopRun + 899
	15  CoreFoundation                      0x0000000102fd4b9e CFRunLoopRunSpecific + 567
	16  GraphicsServices                    0x000000011664cdb3 GSEventRunModal + 139
	17  UIKitCore                           0x00000001120ddaf3 -[UIApplication _run] + 912
	18  UIKitCore                           0x00000001120e2a04 UIApplicationMain + 101
	19  PulleyDemo                          0x000000010202b3eb main + 75
	20  libdyld.dylib                       0x000000010daaf415 start + 1
	21  ???                                 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Degenerate layout! Layout feedback loop detected in subtree of <UIView: 0x7f95d20056e0; frame = (0 0; 375 812); wants auto layout; hosts layout engine; tAMIC = YES; >. More info may be available in the log for com.apple.UIKit.LayoutLoop'
terminating with uncaught exception of type NSException
CoreSimulator 732.17 - Device: iPhone 11 Pro (901DEF38-B212-44BA-AE59-FE05F1397A01) - Runtime: iOS 14.0 (18A372) - DeviceType: iPhone 11 Pro
(lldb) 

@pmacro The xcode12 branch that everyone is reporting as working is equal to the 2.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 the 2.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.