Created
December 1, 2016 13:54
-
-
Save flaviodsilverio/d2f39fa536c548943b93f0fdccccd567 to your computer and use it in GitHub Desktop.
Extension to get the default disclosure indicator from tableview cells
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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