1
Как реорганизовать этот код в Swift 3 ?:Swift 3 неразрешенные CGColorGetComponents идентификатор
extension UIColor {
var hexString: String {
// Produces "Use of unresolved identifier 'CGColorGetComponents'"
let components = CGColorGetComponents(self.cgColor)
....
}
}
Это должно быть 'cgColor.components', хотя это не будет работать, как из Xcode 8 бета-4 , [см. этот вопрос и ответы] (http://stackoverflow.com/questions/38769322/xcode-8-beta-4-cgcolor-components-unavailable) для получения дополнительной информации. – Hamish
Вы можете использовать метод getRed apple-reference-documentation: // hsPr9ZXOsl –