Created
May 8, 2017 01:17
-
-
Save wtsnz/780214509ecab13cfca0ca5397c39c7e to your computer and use it in GitHub Desktop.
Load a UIImage from an xcassets library in your framework.
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
extension UIImage { | |
convenience init?(inCurrentBundleNamed: String) { | |
class BundleClass { } | |
self.init(named: inCurrentBundleNamed, in: Bundle(for: BundleClass.self), compatibleWith: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure if I like the name of the method, open to suggestions!