I\'m trying to load an image from an iOS 8 framework that I\'m writing (in Swift). I\'m using Xcode 6 Beta 6
This code does not work (i.e. load image) if the image i
The accepted answer didn't work for me. Here's a fool proof way for loading an image embedded in a dynamic framework:
var bundle = NSBundle(forClass: self.classForCoder)
if let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/MYLIB.bundle"), resourceBundle = NSBundle(path: bundlePath) {
bundle = resourceBundle
}
let image = UIImage(named: "my-embedded-image", inBundle: bundle, compatibleWithTraitCollection: nil)