NSLayoutConstraint constant not always reflected visually

We are running into a very strange bug in Swift 2/XCode 7b5.

We have a .Top Constraint with a constant that we are adjusting based on a separate scrollview.contentOffset.y to get a paralax effort.

50-60% of the time it works correctly. The rest of the time I can see the Constraint getting updated, but no visual change takes place


print(Constraint?)

Optional(<NSLayoutConstraint:0x7f82621c6d40 V:|-(21)-[UICollectionView:0x7f825f87da00]   (Names: '|':UIView:0x7f82621c4890 )>)


We are sure to call

self.view.layoutIfNeeded()

directly after we update the Constraint


All the views and constraints are being created in code.

In addition, we are not getting any NSLayoutConstraint errors and we have a breakpoint for UIViewAlertForUnsatisfiableConstraints which is not getting triggered

NSLayoutConstraint constant not always reflected visually
 
 
Q