Skip to content

Instantly share code, notes, and snippets.

@yoxisem544
Created November 6, 2019 13:18
Show Gist options
  • Save yoxisem544/1eefe195d1464d7765e9a495b292b248 to your computer and use it in GitHub Desktop.
Save yoxisem544/1eefe195d1464d7765e9a495b292b248 to your computer and use it in GitHub Desktop.
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