Throwing and asynchronous Swift properties
How Swift 5.5 enables computed properties to become either throwing or asynchronous, and what sort of situations that these new capabilities could become useful in.
Articles, podcasts and news about Swift development, by John Sundell.
How Swift 5.5 enables computed properties to become either throwing or asynchronous, and what sort of situations that these new capabilities could become useful in.
A summary of all Swift by Sundell content published during May 2020.
Let’s take a look at a few techniques that can make it much simpler to propagate runtime errors to our users, and how employing some of those techniques could help us present richer error messages without having to add a ton of complexity within each UI implementation.
How an application deals with errors and unexpected values is arguably just as important as how it deals with valid results. Let’s take a look at a few key techniques that can help us provide a better user experience whenever an error was encountered within our code.
How we manage the control flow within the apps and systems that we work on can have a huge impact on everything from how fast our code executes, to how easy it is to debug. This week, let's take a look at how we can use Swift's built-in error throwing and handling model to make our control flow more clear and predictable.
Assertions are not only an essential tool when writing tests - they're also super useful in order to write more predictable and easier to debug code. This week, let's look deeper into assertions, how they work, and how we can implement our own assert functions for performing various checks.
One major focus of Swift is compile time safety — enabling us as developers to easily focus on writing code that is more predictable and less prone to runtime errors. However, sometimes things do fail for various reasons — so this week, let’s take a look at how we can handle such failures appropriately, and what tools we have at our disposal for doing so.
I’d like to share a technique that I’ve come to find quite useful when using Swift’s do, try, catch error handling model — to limit the amount of errors that can be thrown from a given API call.