Advanced Swift: Error Handling

May 28 2019 · Video Course (21 mins) · Advanced

Production code is all about handling errors: programming errors, user input errors, asynchronous errors. This course covers the error fundamentals you need to know.

4/5 1 Rating · Leave a Rating

Version

  • Swift 5, iOS 12, Xcode 10

Introduction

2:48 Free

Robust error handling is a hallmark of high-quality, production code. Let's learn the many ways we can do this.

1

Optionals are a great way of handling superficial errors. Asserts and preconditions can trap programming errors.

2

In this video, learn about how the native error system lets you propagate error information with ease.

3

Let's take a look at how you can define useful errors that let clients take appropriate action in this video.

4

App developers deal with errors from UIKit and other Objective-C libraries. Find out how they work with Swift.

5

The Result Type

3:52 Free

Using a result type is a great way to deal with asynchronous results that may end in error. We explore this useful algebraic type.

6

Add a couple of methods with proper error handling to a File abstraction that uses unsafe Swift to interop with posix and behaves like a Sequence.

7

Conclusion

2:31

Correct error handling is life or death important in many contexts. Apply the concepts you learned here in your app today.

8

Who is this for?

This course is for developers interested in getting a deeper understanding of the Swift language. It expects you to be comfortable with the basic syntax of Swift and to have perhaps written an app or two. You should be familiar with basic types in the Swift standard library.

Covered concepts

This course focuses on:

  • How to express errors
  • try/catch basics
  • Obj-C errors
  • Result types
  • Optionals
  • Asserts

Contributors

Comments