Skip to content

Instantly share code, notes, and snippets.

@flaviodsilverio
Created December 1, 2016 13:54
Show Gist options
  • Save flaviodsilverio/d2f39fa536c548943b93f0fdccccd567 to your computer and use it in GitHub Desktop.
Save flaviodsilverio/d2f39fa536c548943b93f0fdccccd567 to your computer and use it in GitHub Desktop.
Extension to get the default disclosure indicator from tableview cells
extension UIImage {
class func disclosureIndicator() -> UIImage? {
let disclosureCell = UITableViewCell()
disclosureCell.accessoryType = UITableViewCellAccessoryType.disclosureIndicator
for view in disclosureCell.subviews {
if let button = view as? UIButton {
if let image = button.backgroundImage(for: UIControlState.normal) {
return image
}
}
}
return nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment