Last active
October 16, 2023 23:41
-
-
Save AlexandrFadeev/13d274925402ab4641d50d360ea1ebbf to your computer and use it in GitHub Desktop.
UIImage asset identifier extenstion
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 { | |
enum AssetIdentifier: String { | |
case someImageName = "image-name-string" | |
} | |
convenience init!(assetIdentifier: AssetIdentifier) { | |
self.init(named: assetIdentifier.rawValue) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment