What I am doing is shipping a JSON structured string on NSULRRequest, getting rid of the urlscheme prefix, serialize it to JSON and then whatever I can do with it.
urlscheme://{"Type":"photo","Name":"Photo13"}
So I changed NSURLRequest to string by doing
let url = request.URL
let string = "\(url)"
print(string)
but the string appears like
urlscheme://%7B%22Type%22:%22photo%22,%22Name%22:%22Photo13%22%7D
So I have to change it by invoking stringByReplacingOccurrencesOfString over and over on all possible changes.
replacedString = replacedString.stringByReplacingOccurrencesOfString("%7B",
withString: "{",
options: NSStringCompareOptions.LiteralSearch,
range: nil)
.
..
...
Is there a better way to do this in Swift?