Created
February 5, 2018 09:26
-
-
Save Damonvvong/1bf8e242fefc947c784a83ac16293e96 to your computer and use it in GitHub Desktop.
This file contains 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
private final class BundleToken {} | |
extension UIImage { | |
convenience init?(namedInBundle name: String) { | |
let bundle = Bundle(for: BundleToken.self) | |
self.init(named: name, in: bundle, compatibleWith: nil) | |
} | |
} | |
UIImage(namedInBundle: "123") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment