iOS swift NSMutableData has no member appendString : <p>Hello I am new to swift and I am following a tutorial and creating the same code in order to Upload an image . I am now using swift 3 and it seems like <strong>NSMutableData()</strong> no longer has the <strong>appendString</strong> method available what can I do as a substitute ? The tutorial I am following is here <a href="http://swiftdeveloperblog.com/image-upload-example/" rel="noreferrer">http://swiftdeveloperblog.com/image-upload-example/</a> and my code is this</p>

<pre><code>func createBodyWithParameters(parameters: [String: String]?, filePathKey: String?, imageDataKey: NSData, boundary: String) -&gt; NSData {
       let body = NSMutableData()

        if parameters != nil {
            for (key, value) in parameters! {
                body.("--\(boundary)\r\n")
                body.appendString("Content-Disposition: form-data; name=\"\(key)\"\r\n\r\n")
                body.appendString("\(value)\r\n")
            }
        }

        let filename = "user-profile.jpg"
        let mimetype = "image/jpg"

        body.appendString(options: &lt;#T##NSData.Base64EncodingOptions#&gt;)("--\(boundary)\r\n")
        body.appendString("Content-Disposition: form-data; name=\"\(filePathKey!)\"; filename=\"\(filename)\"\r\n")
        body.appendString("Content-Type: \(mimetype)\r\n\r\n")
        body.appendString("\r\n")



        body.appendString("--\(boundary)--\r\n")

        return body
    }
</code></pre>

<p>Again the issue is with the <strong>appendString</strong> as I am getting the error:</p>

<p><em>value of type NSMutableData has no member appendString</em></p>

<p>I been searching for work arounds but have not found any and I have the <strong>append</strong> method available but it does not take a String.</p>
