blog.iankulin.com

Posts

Challenge 1

I built a simple unit conversion app for Challenge 1 of Day 19 of 100 Days of SwiftUI, deliberately keeping it minimal without MVVM. New techniques I covered include limiting the keyboard to numbers and adding a toolbar to dismiss it. I also note that SwiftUI text fields don’t select existing text for overtyping, with no straightforward fix short of a third-party package, and I include full code plus a GitHub link...

$==Commitment

I cover Paul Hudson’s free 100 Days of SwiftUI course and the paid Hacking with Swift+ subscription option. I signed up for a year to support Hudson’s contributions to the Swift community and because the one-year time limit makes it more likely I will complete the course...

Int.times()

I propose adding a times method to Int via an extension, allowing a closure to run a set number of times, in a follow-up to a post about discarding loop variables with an underscore. I find the same idea was already shared as a Stack Overflow answer seven years earlier. I also consider a hypothetical for each in loop syntax, along with why it would likely break existing code...

The _ Underscore

I cover two uses of the underscore in Swift: omitting a parameter’s external name in function calls, and standing in for an unused loop variable when iterating over a collection. I also question whether the loop usage reads well, floating the idea of a reserved word like “each” instead, and note that forEach raises the same naming issue...

Unwrap App

My review of Unwrap, Paul Hudson’s iOS app for learning Swift, which pairs short videos and written lessons with true-or-false questions about Swift code. Though the quizzes sometimes test error-spotting rather than the specific lesson topic, I found they sharpened both my syntax knowledge and my ability to spot mistakes in code. The app is a good way to use spare moments on a phone, even for those not following the Hacking with Swift courses...

Codewars / reduce

Trying out Codewars, I solve a beginner Swift kata about finding the integer that appears an odd number of times in an array, using a Set to track entries. The top community solution turns out to be a one-liner using reduce and XOR, prompting me to explain how reduce works, why XORing every element leaves the odd-occurring value, and to argue that the longer version is still easier to read...

Sometimes the Gold is in the Comments

A SwiftUI tutorial video on @ObservedObject versus @StateObject turns out to be outdated, referencing older APIs like @ObjectBinding and Combine. The experience prompts me to reflect on how technical content should signal its age, such as through version tags, so future readers can judge whether it’s still relevant...

Playgrounds are good

After needing to run small C and C++ snippets and missing Swift Playgrounds, I look at options for scratch coding on an iPad. A C Language app works via an online compiler but feels sluggish, and some paid apps advertised as offline compilation actually send code to a server. Free online compilers that support many languages, including C and Swift, turned out to be a handy alternative...

Named Loops

Breaking out of nested loops to a specific outer loop has no direct support in C/C++, so the traditional workaround is converting for loops to while loops with a continue flag, which I demonstrate with an example that stops processing a string at a given character. Swift offers a cleaner alternative through labeled loops, where naming a loop lets a break statement exit directly to that level...

Checkpoint 9

My solution to Hacking with Swift’s Checkpoint 9: writing a single-line Swift function that returns a random element from an optional integer array, or a random number from 1 to 100 when the array is nil or empty. I show the challenge, an embedded video, and the finished one-liner...

Visual Studio Code

A short review of Visual Studio Code after trying it for HTML/CSS and C++ work on a Mac. I found the experience smooth across the board, praising the painless extension setup, code completion, debugging with breakpoints, and git integration, though Xcode remains my IDE of choice...

CSS Intro

My HTML experience ends in 1996, before CSS existed, so I am catching up on the basics. I share and recommend a Tech With Tim video introducing CSS for non-web developers, embedded in the post...

Checkpoint 8

My solution to Hacking with Swift’s Checkpoint 8: a Building protocol requiring rooms, cost, and estate agent properties, with a protocol extension providing a method that prints a sales summary. My House and Office structs conform to the protocol, each adding its own extra property, and my sample instances show the method in use...

Checkpoint 7

My solution to Hacking with Swift’s Checkpoint 7, which calls for an animal class hierarchy with Animal, Dog, and Cat as superclasses and specific breeds as subclasses. My included Swift code implements the legs property, overridden speak() methods for each breed, and an isTame property set through initializers...

Scope Creep

Applying the project management concept of scope creep to my iOS learning journey, I describe how an original plan of four goals has grown to include extras like git, HTML, JavaScript, and standing up an SQL server on AWS. The overarching aim remains reaching junior iOS developer competence within a year of part-time study...

@ObservedObject v @StateObject

This is a follow-up to my earlier simple MVVM example, correcting my use of @ObservedObject for a view model created inside a SwiftUI view. Because SwiftUI can recreate views at any time, I explain that @StateObject is the correct wrapper in that situation, with @ObservedObject reserved for objects passed down from parent views, and I link to Apple’s documentation and other explanations of the difference...

Rust

Prompted by buzz around Carbon and Rust’s frequent appearances in conversation, I, a developer with a Swift background, take a first look at Rust through a video and a couple of articles. I compare Rust’s features — optionals, type inference, exhaustive match statements, immutability, traits, and closures — against their Swift counterparts, concluding that Rust feels familiar but less readable than Swift...

Vim

Working through MIT’s Missing Semester lecture on Vim, I cover what the editor is, its keyboard-driven approach to editing, and its main modes (normal, insert, and command). I also link to a couple of Vim learning guides and argue that a basic grasp of Vim is a worthwhile requirement for any programmer, since it’s available nearly everywhere the command line is...

Firebase

I muse on a potential future project, a simple accounting app, and whether Google’s Firebase/Firestore could serve as its backend. After watching some CodeWithChris videos on the topic, I conclude that a local SQLite database with iCloud syncing is probably the more realistic approach, though a cloud database would partly address the syncing complications...

iOS Academy

A short post recommending iOS Academy’s brief video tutorials on Swift iOS programming, with an embedded example covering Grid Views. I reflect on how today’s freely shared Swift and iOS learning material differs from the magazines and thick books I relied on when learning to program before the internet...