52inc/Pulley

PulleyPassthroughScrollView's contentView is getting a width and height of 0 initially, breaking constraints

hipwelljo opened this issue · 4 comments

I'm debugging broken auto layout constraints. The problem is this
<NSAutoresizingMaskLayoutConstraint:0x6000034d4af0 h=--& v=--& UIView:0x7fb991c40060.width == 0 (active)>
and this
<NSAutoresizingMaskLayoutConstraint:0x6000034d4b90 h=--& v=--& UIView:0x7fb991c40060.height == 0 (active)>

Checking out the view debugger 0x7fb991c40060 is the UIView inside PulleyPassthroughScrollView, which is the outer container view of the view controller that's embedded in the pull-up drawer. It seems initially its width and height are 0 which is causing the constraints to break. Notably when it's properly sized the layout appears as expected.

Any reason why that would be or what I need to do to accommodate it?

Set your constraint to have a priority of less than one thousand to stop the console warning.

Pulley inits with zero frame and remains that way until UIKit or you give it a frame.

Okay, which constraints need the lower priority?

The constraints of yours that are breaking.

Thanks! For any future viewers, I had to lower the priority of constraints to 999 for a couple subviews of my own scroll view's content view - one leading constraint and one top constraint.