Error handling in Swift
Linked Notes:
Explore structured concurrency in Swift
The idea is based on structured programming. The easiest example is if-else statement where it only execute some block of code conditionally while moving from top to bottom.
Throwing function
From general perspective, it’s one of [[Error handling in Swift]]. In Swift, error is represented by value type (structs, or enum) and conform to the Error protocol. To mark a function that can throw an error, you mark it with throws keyword before the returned value func canThrowErrors() throws ->...