0

I've created a folder in the left pane, which holds various images. It's called "wikiImages". How do I access this folder or get the path to this folder?

I found Bundle.main.resourcePath!, but this seems to access all assets.

Is there a way to access the path to the folder "wikiImages'?

Moondra
  • 4,399
  • 9
  • 46
  • 104
  • is this `wikiImages` folder built into your application bundle or is it files that the user downloads (into `Documents`, for example)? – Michael Dautermann Jul 28 '18 at 21:23
  • Hi, It's built into my application bundle. No user downloads. These images come with the package, so they are built-in. – Moondra Jul 28 '18 at 21:33

1 Answers1

2

Assuming wikiImages lives inside your application bundle's resources folder, you can do something like:

if let resourceFolderURL = Bundle.main.resourceURL {
    let wikiFolderURL = resourceFolderURL.appendingPathComponent("wikiImages")
}

Like as described in this very related question.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215