The description
method of NSArray
and NSDictionary
use \Unnnn
escape sequences for all non-ASCII characters.
In the Xcode sample project that comes with SwiftForms, the submit method
displays this description to the user:
func submit(_: UIBarButtonItem!) {
let message = self.form.formValues().description
let alert: UIAlertView = UIAlertView(title: "Form output", message: message, delegate: nil, cancelButtonTitle: "OK")
alert.show()
}
and the effect is that you see for example
lastName = "B\U00f6se";
But the description
method is only suited for debugging or logging.
What you should do instead is to enumerate all keys and values:
for (key, value) in self.form.formValues() {
println("\(key) = \(value)")
}
which would show you
lastName = Böse
or retrieve the form values that you are interested in:
if let lastName = self.form.formValues()["lastName"] as? String {
println(lastName) // Böse
}