I share a quick tip for downloading an individual file from GitHub without cloning the repository: use the Raw button to get a direct link to the file, then save it via the browser as you would any other web resource...
I complete the Project 4 challenges of the 100 Days of SwiftUI course and compare my solutions to Paul Hudson’s video solutions. Differences covered include Section header syntax, a picker implementation containing a careless bug, and moving a bedtime calculation into a computed property. Finding the comparison useful, I plan to check the video solutions going forward...
Reflecting on how a Tom-Tom GPS once seemed to predict my destinations, I work through Day 27 of 100 Days of SwiftUI, which covers CoreML by training a model in CreateML from Xcode and using it in an app. I note how straightforward the process was and that I’m more excited about small uses of machine learning, like better defaults for user inputs, than ambitious applications. I link to Apple’s machine learning introduction...
Working through Day 26 of 100 Days of Swift, I watch an iOS Academy video on dates, calendars, and date components. My main observation is how long UIKit and storyboard setup takes before any useful code gets written, prompting my appreciation for SwiftUI and Swift Playgrounds as learning tools...
A follow-up to my SwiftUI rock-paper-scissors app built under deadline, working through the improvements noted at delivery. I replace array-and-int game logic with a Swift enum, consolidate separate win/loss checks into a single gameResult function returning a win/loss/draw type, and swap duplicated .hidden() views for an .opacity modifier with a ternary, cutting the view body from 74 lines to 52...
In refactoring my rock-paper-scissors project, I replace Int-based hand shape values with a Swift String enum, eliminating the risk of array out-of-bounds errors and allowing switch statements without a default case. I include notes on Swift enums compared to C, enum methods, and my uncertainty about naming the type Shape versus FingerShape...
A git workflow run-in with the “unrelated histories” error: after pushing my local work to a GitHub repo initialized with a readme, I couldn’t merge the two histories despite pulling and pushing attempts. I ultimately deleted the .git folder and the remote repo and started over, with plans to reproduce the problem later...
A working SwiftUI version of the Hacking with SwiftUI Day 25 project, a Rock, Paper, Scissors game where the player must randomly try to win or lose each round. I share the full source code and list aspects of the implementation I’m unhappy with, such as the array-and-int game state, duplicated win-checking functions, and a hidden-view layout workaround, and note the scoring deviates from the project brief...
I keep a few pre-written blog posts in reserve to maintain a daily publishing schedule and streak, but one tired evening the buffer ran dry. The resulting deadline pressure pushed me to finish a minimum viable version of a half-started project...
A short introductory post explaining why my blog exists: I want to publicly track my progress through Paul Hudson’s 100 Days of SwiftUI, and I believe that writing about a topic forces a clearer understanding of it, an approach known as the Feynman Technique. A Fireship video on the topic is embedded...
While working through Hacking With SwiftUI, I run into two points of confusion around ForEach: what the id: .self key path actually does when looping over an array of strings, and a compiler warning about non-constant ranges such as 0..<agents.count. Attempts to use key paths directly don’t compile, and a forum explanation of the warning — guarding against the array changing size during the loop — leaves me unconvinced...
A short reflection, prompted by a trending ProgrammerHumor meme, on my now-routine git and GitHub workflow. I cover the Pro Git book as my main source of understanding, my preference for the git CLI in a customized zsh terminal over tools like Xcode, and my open questions about consolidating many small learning repos into a single repository...
My solutions to three small SwiftUI challenges: using a ternary with semantic colors to turn the total red at a 0% tip in WeSplit, wrapping the flag Image in a reusable FlagView for GuessTheFlag, and building a custom ViewModifier with a View extension that applies a large blue title style. Each solution includes a short code snippet and a link to my change on GitHub...
With few current podcasts focused on learning Swift, I have been working through older episodes of shows like Fireside Swift and Swift Over Coffee, enjoying hearing past predictions such as Paul Hudson’s doubts about an iPad-capable Xcode. I compare the two seasons of Swift Over Coffee, finding co-host Sean Allen’s beginner questions more useful than the more expert pairing with Erica Sadun, despite her deep Swift knowledge...
A SwiftUI tip on decomposing views by extracting them into custom View structs that accept values at initialization, illustrated with a reusable padded green text component. I favor this approach because such building blocks are portable and can be used in other views...
A look at how I decompose SwiftUI views into smaller pieces: storing view fragments as properties, why properties can’t reference each other, and why a computed property can’t return multiple views without a single container. I cover fixes including wrapping views in a VStack or Group or applying the @ViewBuilder attribute, and I note a quirk where omitting a VStack unexpectedly produced two preview instances...
A short SwiftUI note in which I compare two ways to vary a view based on state: branching with if/else inside the body, which Paul Hudson warns makes SwiftUI destroy and recreate views when the state changes, versus using the ternary operator within a modifier so only the changed property updates. I walk through both code versions and reflect on why the efficiency difference exists...
I give an introduction to SwiftUI views, explaining that views are immutable structs with a body property that SwiftUI renders automatically rather than being drawn manually. I cover container views like HStack and the use of modifiers such as padding and frame, including how modifiers on a container apply to its children and why their order affects the result...
The second tutorial project in my 100 Days series, a flag-guessing game written with everything in the view — an approach I grew uneasy with as the challenges expanded it. Takeaways include string-based image asset identification, alert dialogs in a declarative framework, and gradients and frosted glass effects. Source code is on GitHub...
While working through the 100 Days of SwiftUI, I needed to download a single directory of flag images from a GitHub repo, but found that neither git nor GitHub’s web interface offers a simple way to do that. In this post, I cover a workaround using GitHub’s web-based VSCode: change github.com to github.dev in the repo URL, then right-click the folder to download it...