Category: Posts
-
Challenge 1
I’m up to Challenge 1 of 100 Days of SwiftUI (Day 19) which is to make your own simple (no MVVM) version of the app built in the previous three days. It’s about as simple as can be whilst still feeling like a real app. Something I hadn’t done before was limiting the keyboard to…
-
$==Commitment
Paul Hudson’s 100 Days of Swift UI course is free – the videos are on YouTube, all the reading and tasks are available on his website for free. Although I assumed he made his living from the prodigious number of Swift books he’s written, he doesn’t push them in the course (except for his free…
-
Int.times()
When writing yesterday’s post about iterating through a range or collection and using the underscore to throw away the item, I had in the back of my mind that there should be a more straightforward way of doing something a number of times. Just to re-iterate (lol), here’s the issue. If we want to print…
-
The _ Underscore

I’ve learned (so far) an underscore can be used for a couple of things in Swift, both of them loosely translating to “doesn’t really matter”. The first is in a parameter name for a function. Swift has a very cool feature I haven’t seen before where an argument can have a different internal and external…
-
Uwrap App
Part of the @twostraws programmatic universe is his Swift learning app, Unwrap that I’ve included in my learning goals. It presents little snippets of learning with a 60 second video, and in a written version, then tests the user to check their understanding. It is slightly gamified – you get points for answers, but it’s…
-
Codewars / reduce
codewars.com is a “coding practice” website. You chose a language and a skill level, then it offers up a task (or kata) for you to write a suitable function. The first one it gave me was seemed too hard, so I changed my level to beginner and skipped to the next one. This was my…
-
Sometimes the Gold is in the Comments
I’m still not 100% clear on @ObservedObject v @StateObject. So when YouTube offered up this video, in which Paul promises during the intro that I’ll understand the data bindings by the end, I thought it would be the video for me. I guess I should really have twigged that I’d never heard of @ObjectBinding, but…
-
Playgrounds are good
A couple of times (Protocols & Named Loops) in the past few days I’ve needed to write and run a couple of tiny C or C++ snippets, and I’ve acutely felt the lack of Swift Playgrounds for it. It occurred to me that Playgrounds has been instrumental in my enjoyment of learning Swift – it’s…
-
Named Loops
Here’s a neat thing I haven’t seen before. Other languages I’ve worked in haven’t had a neat way to break out of a set of nested loops to a particular loop. It’s not an issue that comes up a lot, but when it has I’ve solved it by creating a continue flag and having that…
-
Checkpoint 9