0

When using NSBundle, is there a macro such as $(APP_BUNDLE) or something similar, so that I can use a specific file?

  • You would normally use the `func url(forResource: String?, withExtension: String?) -> URL?` method on a bundle to access files shipped (bundled) with your app. To use files created by your app you would use the file manager – Scriptable Jun 17 '20 at 10:29
  • Does this answer your question? [How to access file included in app bundle in Swift?](https://stackoverflow.com/questions/37580015/how-to-access-file-included-in-app-bundle-in-swift) – zrzka Jun 17 '20 at 12:22

1 Answers1

0

You might be looking for NSBundle.mainBundle which returns a reference to the NSBundle for the application. Using this and the various instance methods provided by NSBundle you may then determine the paths/URLs of the files packaged within the application bundle.

CRD
  • 52,522
  • 5
  • 70
  • 86