• Fabio

    hello Sergey , the following code gives me this error , can you help me ? Best regards.

    • Hi Fabio! If you are not using Xcode 7 and Swift 2, then simply remove the “do {” and the “} catch { print(error) }” lines…. also you will need to remove the “try” in the line NSJSONSerialization.JSONObjectWithData….

      Please let me know if it helped.

      • Fabio

        Hi Sergey,
        i did as you told me, but now i get this error.
        I use XCODE 6.4 and SWIFT2.
        Thank you for the help.

        • Hi Fabio. I think I know what it is going on…. Please replace this line with this two lines:

          var err: NSError?

          var json = NSJSONSerialization.JSONObjectWithData(data, options: .MutableContainers, error: &err) as? NSDictionary

          • Fabio

            Hi Sergey,
            it works !!!
            Best regards,


  • Riaz

    Hi Sergey,
    I just started to swift and I’m using a list of rows (with 3 columns: name, address, zipcode) from MySQL which I wanted to bring to UITableViewCell.


    So I get this
    [{“name”:”Albert”,”address”:”Phoenix”,”zip”:”12345″}, {“name”:”Robert”,”address”:”Paris”,”zip”:”12345″}]

    Do you mind, explain me how to bring this as dictionary and list in TableView? Really helpful 🙂

    • Sorry for delayed response. I am traveling this week and do not have access to the internet. Please have a look at this video tutorial. I execute mysql search and display JSON data returned in TableView. http://swiftdeveloperblog.com/case-insensitive-search-with-swift-php-and-mysql/

      • Riaz

        Thanks a lot.. It works great… Learning new things everyday. I subscribed to your YT channel and learning. Your videos are great and very helpful. Within a week I already started to build app. Thanks once again. ( :

        Also I watched your UIDatePicker to implement inline date but unable to figure it out. I have a TableView with UILabel of date and time for the user to enter the date and time and when the user tapped, I wanted to popup the DatePicker at the bottom of the screen.

        I tried searching your blog but unable to find it. Can you help on this please? Really appreciate.

        • Thank you for your message! I do not have a video on inline date picker and I think it would be very good to have one. I will try to find out some time to squeeze it in between of tasks I am currently working on. Stay tuned!

  • dancingbush


    I am geeting a exception thrown when trying to get array from the JSON :

    let json = try NSJSONSerialization.JSONObjectWithData(data!, options: .MutableContainers) as? NSArray;

    :App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.

    Cant see an option to change this in plist, i am using Xcode 7.


    PS Great tutorial, very clear and concise.

  • dancingbush

    actually just added this to info.plist:


  • Karina

    Hello, if more items to your three lists and scroll down in the first one and then click on another segment , you will see that still in the same position as in the first list. I was supposed to start at zero cell in the second segment, be independent cells in the same table view, is that possible??? I can’t find the solution for this, do I have to use 3 tableviews to fix this issue?