This question already has an answer here:
- Xcode 8 Beta 4 CGColor.components unavailable 5 answers
How can I refactor this code in Swift 3?:
extension UIColor {
var hexString: String {
// Produces "Use of unresolved identifier 'CGColorGetComponents'"
let components = CGColorGetComponents(self.cgColor)
....
}
}