I am trying to locate a file in a subdirectory of subdirectory of my bundle. I used this code to create an UIImage with init(contentsOfFile:)
.
let resource = NSBundle.mainBundle().pathForResource("1g", ofType: "jpg", inDirectory: "Level1")
let image = UIImage(contentsOfFile: resource!)
What am I doing wrong?
EDIT:
This works because groups you create in xcode editor do not affect the actual path.
let resource = NSBundle.mainBundle().pathForResource("1g", ofType: "jpg", inDirectory: nil)
or let resource = NSBundle.mainBundle().pathForResource("1g", ofType: "jpg")