Skip to content

Instantly share code, notes, and snippets.

@bestimmaa
Created November 11, 2015 09:04
Show Gist options
  • Save bestimmaa/1bff5f473ea9c01de923 to your computer and use it in GitHub Desktop.
Save bestimmaa/1bff5f473ea9c01de923 to your computer and use it in GitHub Desktop.
iOS Custom UITableViewCell Seperator
// Use a custom seperator of full width
UIView *lineView = [[UIView alloc] init];
lineView.backgroundColor = kColorSeperator;
lineView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:lineView];
[lineView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.contentView];
[lineView autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.contentView];
[lineView autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:self];
[lineView addConstraint:[NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeHeight multiplier:1.0 constant:1]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment