IBM Watson Tone Analyzer API with Swift
<p>I am working with IBM Watson Tone Analyzer API using Swift. I tried the following code:</p>

<pre><code>override func viewDidLoad()
    {
        print("hello")
        super.viewDidLoad()
        let username = "USERNAME"
        let password = "PASSWORD"
        let versionDate = "2016-05-19" // use today's date for the most recent version
        let service = ToneAnalyzer(username: username, password: password, version: versionDate)

        let failure = { (error: NSError) in print(error) }
        service.getTone("Text that you want to get the tone of", failure: failure) { responseTone in
            print(responseTone.documentTone)
        }

    }
</code></pre>

<p>For this, I am getting the following error:
Error Domain=com.alamofire.error Code=-6004 "Data could not be serialized. Failed to parse JSON response. No error information was provided during serialization." UserInfo={NSLocalizedFailureReason=Data could not be serialized. Failed to parse JSON response. No error information was provided during serialization.}</p>

<p>I read the documentation but it does not help to solve this problem.</p>