Is it a bug of Swift 5.0.1 or Xcode?
This is in the playground with Xcode 10.2.1.
The codes are:
extension UIColor {
@objc class var myGolden: UIColor {
return self.init(red: 1.000, green: 0.894, blue: 0.541, alpha: 0.900)
}
}
print(UIColor.myGolden)
class MyUIColor: UIColor {
override class var myGolden: UIColor {
return super.init(red: 1.000, green: 0.894, blue: 0.541, alpha: 0.750)
}
}
print(MyUIColor.myGolden)
The playground does not indicate any error for the class MyUIColor
The output is:
UIExtendedSRGBColorSpace 1 0.894 0.541 0.9
libc++abi.dylib: terminating with uncaught exception of type NSException
and the runtime error says:
error: Execution was interrupted, reason: signal SIGABRT. The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.