I was on my way to override UIImage class method init(named:)
. My goal is to be able to retrieve the file name of an image.
The code would look like this:
class UIImageWithFileName: UIImage {
let fileName: String
override init(named:String){
super.init(named)
fileName = named
}
}
This code seems to be impossible for following reasons.
I created a subclass of UIImage, started typing init... and to my surprise there was no init(named:) method to override. Here is a complete list of init methods:
How does one override UIImage init(named:)