Skip to content

Instantly share code, notes, and snippets.

View johanforssell's full-sized avatar

Johan Forssell johanforssell

  • NaN
  • Sweden
  • 20:42 (UTC +02:00)
View GitHub Profile
// in a UITableViewController (or any other view controller with a UITableView)
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, size.width, 0)]; // You might have to set height to 9999 or very high
header.translatesAutoresizingMaskIntoConstraints = NO;
// [add subviews and their constraints to header]
NSLayoutConstraint *headerWidthConstraint = [NSLayoutConstraint