You can reverse an Array, and any other Collection in Swift using the reverse method. For example var input = [1, 2, 3] print(input) // [1, 2, 3] input.reverse() print(input) // [3, 2, 1] The code above takes an array (input) and reverses it in-place using the reverse() method. This only works if your array […]
Read post
Subscribe to my newsletter and never miss a post
Learn more about Swift fundamentals
Swift allows us to use a static prefix on methods and properties to associate them with the type that they’re declared on rather than the instance. We can also use static properties to create singletons of our objects which, as you have probably heard before is a huge anti-pattern. So when should we use properties […]
Read postWe all want to write good, beautiful and stable code. This includes preventing memory leaks, which we can, using [weak self] when writing a closure that needs access to self. But what’s the real reason for needing this weak capture? And do we need it all the time? In this week’s Quick Tip, I want […]
Read postmap, flatMap, compactMap… how to decide? In this post you’ll learn about differences and similarities that can make it tricky to decide which one fits your use case best.
Read postFor loops are an incredibly useful feature in the Swift language. In this post, you’ll learn everything there is to know about for loops. This includes more obscure techniques like naming your loops.
Read postMany applications work with data, often they are built to retrieve data and display this data to the user in a table view, collection view, list (if you’re using SwiftUI) or a different kind of component. It’s not uncommon for this data to change and when it does you might be interested in figuring out […]
Read postWhenever I’m programming, I have a goal in mind, generally a problem to solve. I want my solutions to be simple, yet elegant and reliable. Thankfully, Swift is a great language for this. The language is safe, its syntax is beautiful with great readability. The way Swift handles nullability with Optional contributes greatly to its […]
Read postThere are times when you need to extract a subset of an array. For example, you might need to find all elements in an array at an odd index. Or maybe you need all items at an even index. In other words, you’re looking for every "other" element in an array. This might seem like […]
Read postExpand your learning with my books

Learn everything you need to know about Combine and how you can use it in your projects with Practical Combine. It contains:
- Thirteen chapters worth of content.
- Playgrounds and sample projects that use the code shown in the chapters.
- Free updates for future iOS versions.
The book is available as a digital download for just $39.99!
Learn more