Skip to content

Instantly share code, notes, and snippets.

@aqubi
Created June 1, 2020 15:20
Show Gist options
  • Save aqubi/d03dbef5b8cc84abd992b703a342b397 to your computer and use it in GitHub Desktop.
Save aqubi/d03dbef5b8cc84abd992b703a342b397 to your computer and use it in GitHub Desktop.
class SURMasterTableViewCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
updateAccessoryType()
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
updateAccessoryType()
}
private func updateAccessoryType() {
self.accessoryType = traitCollection.horizontalSizeClass == .compact ? .disclosureIndicator : .none
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment