Рет қаралды 4,031
This video's focus is on Associated Values in Enums.
As well as storing a simple value, enums can also store associated values attached to each case. This lets you attach additional information to your enums so they can represent more specific information.
In this video we will see how we can work with associated values and as a bonus I investigate a very special one, the Swift Result Type and how it all ties in with thowing functions and completion handlers.
Table of Contents:
0:00 Introduction
1:41 Associated Types
4:59 Associated Values
10:24 Completion Handers and and Throwing Functions
15:34 The Result Type
Starter Project Files:
www.createchsol.com/StarterPro...
Completed Project:
github.com/StewartLynch/Enum-...
Other Enum videos
Introduction to Enums
• Introduction to enums ...
Using Enums #1
• Using Enums Example 1
Multiple Sheets in SwiftUI with Enums
• Enums for Multiple Sheets
Other references:
Completion Handlers:
• Completion Handlers
The Swift Result Type:
• A Better Result
Throw, Try Try? Try! Catch
• Throw, Try, Try? Try! ...
Other References:
Stewart Lynch's KZfaq Channel:
/ stewartlynch
Stewart Lynch on Twitter:
/ stewartlynch
CreaTECH Solutions Website:
www.createchsol.com
Stewart Lynch's GitHub:
github.com/StewartLynch
Buy me a coffee :)
ko-fi.com/stewartlynch
******* Download my StewartLynch KZfaq Channel Application - Free **********
stewartlynch.gumroad.com/l/obsjz