Created
March 12, 2021 08:02
-
-
Save jeandavid/69280ab3dd1597061377fb6b37a323b0 to your computer and use it in GitHub Desktop.
Accessing Resources from Framework
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 class BundleFinder {} | |
public class MyView { | |
let imageView = UIImageView() | |
func setImage() { | |
let frameworkBundle = Bundle(for: BundleFinder.self) | |
let image = UIImage(named: "my_image", in: frameworkBundle, with: nil) | |
imageView.image = image | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment