Created
November 6, 2019 13:18
-
-
Save yoxisem544/1eefe195d1464d7765e9a495b292b248 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal struct WrappedBundleImage: _ExpressibleByImageLiteral { | |
let image: UIImage? | |
init(imageLiteralResourceName name: String) { | |
image = UIImage(named: name, in: <ANY_BUNDLE>, compatibleWith: nil) | |
} | |
} | |
extension UIImage { | |
static func fromWrappedBundleImage(_ wrappedImage: WrappedBundleImage) -> UIImage? { | |
return wrappedImage.image | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment