Skip to content

Instantly share code, notes, and snippets.

@jeandavid
Created March 12, 2021 08:02
Show Gist options
  • Save jeandavid/69280ab3dd1597061377fb6b37a323b0 to your computer and use it in GitHub Desktop.
Save jeandavid/69280ab3dd1597061377fb6b37a323b0 to your computer and use it in GitHub Desktop.
Accessing Resources from Framework
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