Part 2
Enums, Result, Swift Extensions

We will focus in this video on learning about enumerations (enums) and the Result data type, a special enum available in Swift 5. We will also learn about Swift extensions: what they are, what we can do in extensions, and what we cannot do, culminating with creating our first Swift extension. Then we will make a plan for refactoring our previously written JSON decoding function, so that this time our function will return a Result type instead of an optional custom structure. We will continue in the next video with implementing the plan developed in this video, so stay tuned...

Outline

  • The new Result data type (a special enum)

  • What are enumerations (enums)

  • The switch syntax

  • What are Swift extensions?

    • What is allowed in an extension?

    • What is NOT allowed in an extension?

    • Syntax for creating Swift extensions

  • Planning to Refactor Our JSON Decoding Function