do { // Convert JSON Object received from server side into Swift NSArray. // Note the use "try" if let convertedJsonIntoArray = try JSONSerialization.JSONObjectWithData(data!, options: []) as? NSArray { } } catch let error as NSError { print(error.localizedDescription) }
Have a look at this blog post of mine in which I demonstrate how to Display a Large Collection of Images in UITableView with SDWebImage. The example demonstrates the use of do, try and catch while converting a server side response(JSON Array of elements) into NSArray.
[raw_html_snippet id=”cookbookpagecoursesheader”]
Unit Testing Swift Mobile App
Apply Test-Driven Development(TDD) process to iOS mobile app development in Swift Preview this video course.