blog.iankulin.com

Swift5-6

Using Swift's map

While working through Day 39 of the Hacking with Swift 100 Days of SwiftUI course, I explain Swift’s map method, which applies a closure to each element of a collection and returns a transformed array. Simple Playground examples demonstrate mapping integers to strings, with equivalent forEach and for loop versions included for comparison...

Ranges

A follow-up to my previous post about the difference between writing a SwiftUI ForEach range as 1..<21 versus 1…20. I found the answer in a Hacking with Swift Day 34 article, which indicates older versions of Swift might not have allowed the closed-range form...

How to upgrade XCode and Swift

A short note on updating to Xcode 14 and Swift 5.7: the update is found in the Mac App Store rather than Xcode’s About dialog. I also show how to check your current Xcode and Swift versions, both through Xcode’s project settings and via the command line, and link elsewhere for details on what’s new in each release...