Check out my work on https://github.com/webdavis/webdavis
Since there are no associated value types the compiler says we can compare instances of this Error type and slaps on the Equatable protocol at compile time.
Since there are no associated value types the compiler says we can compare instances of this Error type and slaps on the Equatable protocol at compile time.
Here is an enum *with* associated value types:
Here is an enum *with* associated value types:
No where in this code did we explicitly conform the Error type to Equatable:
No where in this code did we explicitly conform the Error type to Equatable:
Whenever I commented out the following line in the interface boundary, I would then get the accompanying compile-time error in the test code:
Whenever I commented out the following line in the interface boundary, I would then get the accompanying compile-time error in the test code:
Now let's see what it would be like to implement the same behavior without this syntax. We could convert this to a do-catch block, like so:
Now let's see what it would be like to implement the same behavior without this syntax. We could convert this to a do-catch block, like so:
(3/7)
Take a look at the following static function. Why isn't there a do-catch block to catch the potential error that JSONDecoder().decode throws?
(3/7)
Take a look at the following static function. Why isn't there a do-catch block to catch the potential error that JSONDecoder().decode throws?
If we want to add more behavior to the view controller, then we just add another adapter that implements the delegate:
If we want to add more behavior to the view controller, then we just add another adapter that implements the delegate:
Log: github.com/webdavis/100...
🧩 Delegates allow us to Extend the Behavior of a Client (1/5)
This is why UIKit.UITableView includes a DataSource/Delegate.
Here's the architecture:
Log: github.com/webdavis/100...
🧩 Delegates allow us to Extend the Behavior of a Client (1/5)
This is why UIKit.UITableView includes a DataSource/Delegate.
Here's the architecture: