Tag

swift-in-depth

Programming Tricks with Swift: when to use enums instead of subclassing

From Swift in Depth by Tjeerd in ‘t Veen

In this article, we’re going to explore these limitations of modeling our data via subclassing in a real-world scenario and how to address those limitations with the help of enums.

When to Use “or” and “and” in Swift

From Swift in Depth by Tjeerd in ‘t Veen

This article, adapted from chapter 2 of Swift in Depth, discusses the “or” and “and,” also known or sum and product types, respectively, and how they can be used in Swift.

© 2021 Manning — Design Credits