mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Overlays are specifically allowed to do magic things that regular Swift modules are not. In this case, the UIImage and NSImage overlays have extensions that allow them to conform to `_ExpressibleByImageLiteral`. This, unfortunately, means that subclassing these classes with the overlays present is impossible as one must override the required initializers, but one cannot override these initializers since they are declared in an extension. While we cannot correct the overlays without breaking ABI, we can at least make sure we don't attempt to stick @objc into them when users have a go at subclassing these classes. Resolves rdar://59610201
13 lines
323 B
Swift
13 lines
323 B
Swift
@_exported import ImageInitializers
|
|
|
|
extension Image : _ExpressibleByImageLiteral {
|
|
private convenience init!(failableImageLiteral name: String) {
|
|
self.init(named: .init(name))
|
|
}
|
|
|
|
@nonobjc
|
|
public required convenience init(imageLiteralResourceName name: String) {
|
|
self.init(failableImageLiteral: name)
|
|
}
|
|
}
|