Skip to content

Instantly share code, notes, and snippets.

@cockscomb
Created November 4, 2017 11:36
Show Gist options
  • Save cockscomb/5c93d6d8cd47087255690340cee377bf to your computer and use it in GitHub Desktop.
Save cockscomb/5c93d6d8cd47087255690340cee377bf to your computer and use it in GitHub Desktop.
diff --git a/SelfSizingAutoLayoutCell/SelfSizingAutoLayoutCell.m b/SelfSizingAutoLayoutCell/SelfSizingAutoLayoutCell.m
index 0acbbe5..db816f3 100644
--- a/SelfSizingAutoLayoutCell/SelfSizingAutoLayoutCell.m
+++ b/SelfSizingAutoLayoutCell/SelfSizingAutoLayoutCell.m
@@ -47,7 +47,9 @@ NS_ASSUME_NONNULL_BEGIN
[constraints addObject:[autolayoutView.topAnchor constraintEqualToAnchor:self.contentView.topAnchor constant:10.0]];
[constraints addObject:[autolayoutView.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor constant:10.0]];
[constraints addObject:[self.contentView.trailingAnchor constraintEqualToAnchor:autolayoutView.trailingAnchor constant:10.0]];
- [constraints addObject:[self.contentView.bottomAnchor constraintEqualToAnchor:autolayoutView.bottomAnchor constant:10.0]];
+ NSLayoutConstraint *constraint = [self.contentView.bottomAnchor constraintEqualToAnchor:autolayoutView.bottomAnchor constant:10.0];
+ constraint.priority = 999;
+ [constraints addObject:constraint];
[NSLayoutConstraint activateConstraints:constraints];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment