Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSBundle *frameworkBundle = [NSBundle bundleForClass:[FrameworkClass class]];
- NSString *resourcePath = [frameworkBundle pathForResource:@"an_image" ofType:@"jpeg"];
- UIImage *image = [UIImage imageWithContentsOfFile:resourcePath];
- [[NSBundle mainBundle] pathForResource:@"FI.framework/Resources/FileName"
- ofType:@"fileExtension"];
- let bundle = Bundle(for: SomeFrameworkClass.self as AnyClass)
- if let path = bundle.path(forResource: "test", ofType: "png") {
- if let image = UIImage(contentsOfFile: path) {
- // do stuff
- }
- }
- let bundle = Bundle(for: type(of: self))
- let path = bundle.path(forResource: "filename", ofType: "json")!
- let url = URL(fileURLWithPath: path)
- let data = try! Data(contentsOf: url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement