Hi everyone,
I'm trying to learn iOS/Swift development (please assume that I know nothing!) and I need to connect to a REST/JSON Web service and pull back data. I've found a few samples online but most of them are in Objective-C, and the only Swift one that I've been able to find doesn't work.
I've been using this one http://network-development.blogspot.co.nz/2014/06/access-rest-web-service-with-apples-new.html and if I copy ITunesSearchAPI.swift without any changes and try to build then I get five errors and a warning (not copied verbatim):
More importantly, can someone please suggest a working sample?
Thanks
I'm trying to learn iOS/Swift development (please assume that I know nothing!) and I need to connect to a REST/JSON Web service and pull back data. I've found a few samples online but most of them are in Objective-C, and the only Swift one that I've been able to find doesn't work.
I've been using this one http://network-development.blogspot.co.nz/2014/06/access-rest-web-service-with-apples-new.html and if I copy ITunesSearchAPI.swift without any changes and try to build then I get five errors and a warning (not copied verbatim):
- stringByAddingPercentEscapesUsingEncoding is deprecated
- Value of optional type 'NSURL?" not unwrapped
- Value of optional type 'NSURLConnection?' not unwrapped
- 'println' and been renamed to 'print' (x2)
- Extra argument 'error' in call
More importantly, can someone please suggest a working sample?
Thanks