O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, we got familiar with optional types. We talked about built-in techniques to deal with Optionals such as optional binding, guard, coalescing, and optional chaining. Then we explored functional programming techniques to deal with Optionals. We created fmap and apply functions and related operators to tackle multiple optional binding problems. Even though some developers may prefer to use built-in multiple optional binding, exploring functional programming techniques practically provides a better understanding of concepts that we will be able to apply to other problems.

Finally, we briefly looked into error handling concepts and how to convert errors to optional values.

In the next chapter, we will explore some examples ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required