Skip to content

Instantly share code, notes, and snippets.

@mteera
Last active January 22, 2018 15:44
Show Gist options
  • Save mteera/8b4228e7b683b1687ca39c46649f9e5d to your computer and use it in GitHub Desktop.
Save mteera/8b4228e7b683b1687ca39c46649f9e5d to your computer and use it in GitHub Desktop.
An extension for UITableViewCell's to hide the seperator
extension UITableViewCell {
var isSeparatorHidden: Bool {
get {
return self.separatorInset.right != 0
}
set {
if newValue {
self.separatorInset = UIEdgeInsetsMake(0, self.bounds.size.width, 0, 0)
} else {
self.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0)
}
}
}
}
// Usage: isSeperatorHidden = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment