Rename file in DocumentDirectory
<p>I have a PDF file in my <code>DocumentDirectory</code>.  </p>

<p>I want the user to be able to rename this PDF file to something else if they choose to.  </p>

<p>I will have a <code>UIButton</code> to start this process. The new name will come from a <code>UITextField</code>.  </p>

<p>How do I do this?  I'm new to Swift and have only found Objective-C info on this and am having a hard time converting it.</p>

<p>An example of the file location is:</p>

<blockquote>
  <p>/var/mobile/Containers/Data/Application/39E030E3-6DA1-45FF-BF93-6068B3BDCE89/Documents/Restaurant.pdf</p>
</blockquote>

<p>I have this code to see check if the file exists or not:</p>

<pre><code>        var name = selectedItem.adjustedName

        // Search path for file name specified and assign to variable
        let getPDFPath = paths.stringByAppendingPathComponent("\(name).pdf")

        let checkValidation = NSFileManager.defaultManager()

        // If it exists, delete it, otherwise print error to log
        if (checkValidation.fileExistsAtPath(getPDFPath)) {

            print("FILE AVAILABLE: \(name).pdf")

        } else {

            print("FILE NOT AVAILABLE: \(name).pdf")

        }
</code></pre>