Where to put the text files when I distribute the app?
<p>I have a simple application that needs to read multiple text files. But right now in order to access the files I am giving the address of the file in my laptop. </p>

<pre><code>let path = "/Users/alimashreghi/Desktop/glossories/science.txt"
var text:String = ""

do{

   text = try NSString(contentsOfFile:path, encoding: NSUTF8StringEncoding) as String

}catch{

}
</code></pre>

<p>Now, I am concerned about when I want to distribute the app. Where should I put the text files and how should I read them to ensure that it works properly as an app in an iPhone?</p>

<p>Besides, I don't know much about distributing swift apps.</p>

<pre><code>    //
//  ViewController.swift
//  Test
//
//  Created by Ali Mashreghi on 2016-08-29.
//  Copyright © 2016 Ali Mashreghi. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
    let data = NSData.init(contentsOfFile: "/Users/TestProj/science.txt") //prints Optional(4380)
    let data = NSData.init(contentsOfFile: "science.txt") //prints nil

    print(data?.length)

    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}
</code></pre>

<p>}</p>

<p><a href="https://i.stack.imgur.com/EavES.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EavES.png" alt="enter image description here"></a></p>