small medium large xlarge

28 Aug 2017, 11:33
Sarun Wongpatcharapakorn (5 posts)

Success path is easy to understand, it save to core data and NSFetchedResultController pickup the update.

But for error, if I want to show UIAlertController error from server/ or network loss error how would I do that?

28 Aug 2017, 13:09
Marcus S. Zarra (283 posts)

There are a few ways.

Your operation can post a notification on the error for the UI to present or the operation could have a callback/completion block that hands back the error to the UI.

Those are my two normal ways to handle it. However, I try to avoid presenting errors to the user whenever possible. Unless it is a login error or something along those lines, they are rarely helpful.

You must be logged in to comment