Respond to CR.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-10-23 17:30:03 -04:00
parent b1b0ddbf2e
commit a16197f193

View file

@ -15,6 +15,13 @@ NS_ASSUME_NONNULL_BEGIN
if (frame.size.width == 0 || frame.size.height == 0) {
// Ignore iOS Auto Layout's tendency to temporarily zero out the
// frame of this view during the layout process.
//
// The conversation view has an invariant that the collection view
// should always have a "reasonable" (correct width, non-zero height)
// size. This lets us manipulate scroll state at all times, especially
// before the view has been presented for the first time. This
// invariant also saves us from needing all sorts of ugly and incomplete
// hacks in the conversation view's code.
return;
}
BOOL isChanging = !CGSizeEqualToSize(frame.size, self.frame.size);
@ -32,6 +39,13 @@ NS_ASSUME_NONNULL_BEGIN
if (bounds.size.width == 0 || bounds.size.height == 0) {
// Ignore iOS Auto Layout's tendency to temporarily zero out the
// frame of this view during the layout process.
//
// The conversation view has an invariant that the collection view
// should always have a "reasonable" (correct width, non-zero height)
// size. This lets us manipulate scroll state at all times, especially
// before the view has been presented for the first time. This
// invariant also saves us from needing all sorts of ugly and incomplete
// hacks in the conversation view's code.
return;
}
BOOL isChanging = !CGSizeEqualToSize(bounds.size, self.bounds.size);