Swift 3: Twitter - Handling Network and JSON Errors (Ep 14)

preview_player
Показать описание
Today, let's discuss Network Errors and how to modify our completion handler to notify us of them. The most important error to handle when dealing with network calls is the 404 page not found error. This can commonly occur if you do not have connection to the internet or if the endpoint is not responding.

We'll look at a solution to present an error message in the UI when we encounter this error.

Finally, we'll examine how invalid json will crash our app and then I'll go into detail on how to apply an easy fix.

Enjoy.

Facebook Group

iOS Basic Training Course

Completed Source Code

Комментарии
Автор

Thanks so much for this Brian! I've been seeing the 'blank collection view screen' from time to time in my app (when I forgot to run json-server) and I realized I definitely need to handle errors.

bennychewDev
Автор

Indeed, your videos has became my addiction already. Keep going men and thanks for all! Hope to see some videos giving some insights into Core Data, It'd be fantastic!

foocux
Автор

Awesome series for iOS Development. Please add deep link, user to user notification and more advanced. Thanks.

paingsoe
Автор

LBTA in the background, i see what you did there with the TV :)
Another great lesson, thanks !
I'll definitely be using LBTA components in the future.

Souls
Автор

Which one is better to use? Completion block with data and error parameters or success/failure handlers?

theJeraldo
Автор

Cant wait for generics. Thanks for that!

arvidurs
Автор

Once again really nice video Brian!
Would be nice to talk about handling memory too, especially in big json with many images, when a user download for the first time the app, my app, is going crazy with the memory usage, although i cache them (with kingfisher) and i'm using MVC patterns like you do. Any recomendation ?
P.S. the images are being downloaded in the cell swift file, if they dont exist in the cache.

kwstasna
Автор

Hi Brian,

I am new to iOS App Development and I purchased Basic Training Course and it was amazing, however I need a clear path, How can I go forward, Is there any books that I can purchase having the same way of teaching you have, Do you recommend watching your Video Courses in some sequence? Please guide me and thank you very much.

ahmedabdou
Автор

Great stuff - good to see some good ideas for proper error handing - thanks

rogerwprice
Автор

This was great Brian. Keep it coming.

NickPerkins
Автор

Great videos and insight into App building and managing... What if someone wants to learn to do this stuff but does not have the money to pay a college to teach them, is there any websites, free tools, etc. that can help someone get to the beginner/ intermediate level of programming/ coding? Also what about certifications, I saw Microsoft has a MCSA and MCSD and was wondering your thoughts?

MrSean_S
Автор

thank you, I kinda started to see the pattern of doing things the wrong way and then fixing them to be confusing and time consuming, i guess would be enough if just point it out verbally.

silver
Автор

Hi,
Please include a way to create a generic class or function for parsing the JSON response, into respective model classes passed as type parameter in your next generic video. For Eg: func [String: Any]?, model: Model) -> Model. where Model is a POJO class. (NSObject). This will help reduce lot of code.
Thanks for your awesome tutorials!! 👍

ashirvadaj
Автор

Do you want to add fire base into this app?

Anthony-dsse
Автор

How do you check whether the device is connected to internet by any means. I have tried exploring reachability class but could not integrate into the app.

sanawfal
Автор

Hi Brian, what is the best way to make a retry functionality in an API with authentication and refresh_token endpoint.
If I get 401 status code, I need to refresh the token, what is best way to recall my actual request function?

dantesolorio
Автор

Do you plan on making Android tutorials as well?

m
Автор

How can you get Facebook, Twitter and Instagram videos or media to integrate with third party app?

sgangsta
Автор

Is the "Parsing JSON was not valid" message intended to be displayed to the user? Maybe I missed it, but I don't think you showed that being displayed... was curious. Or, is that message not intended for the user and we'd only expect to see the default label text when the JSON fails?

jbee
Автор

Hi, i really like your video. By the way are you Chinese? Do you mind if i upload your video to Chinese video websites?

halifaxdeveloper