iTerm2 microphone permission for Claude Code
How to grant microphone permission to iTerm2 on macOS to use with Claude Code voice mode
A blog about testing, iOS development, productivity, and blabber about software in general.
How to grant microphone permission to iTerm2 on macOS to use with Claude Code voice mode
How to add roms and save files to the RG35XX Plus 2nd SD card on the stock OS
How to load cheat codes for the Pokémons Emerald starters on the Delta emulator app for iOS
A code generation story.
Unit tests are a vital tool for writing quality code. They also happen to be the best kind of documentation for your software, the kind that never gets out of date.
Test-Driven Development is an excellent way of writing code but many people push back against it. To convince your team to adopt it, lead by example. Don't preach. Let the quality of the code your wrote with TDD talk for itself and only suggest TDD when people ask about it.
My current thoughts on which merge strategy to use on GitHub. "Create a merge commit" will help you make sense of how code changed over time without removing the option for a high-level overview of the changes on the main branch.
Each XCTNSPredicateExpectation requires a timeout of at least 1.1 seconds. That's will unnecessarily slow down your test suite. You can use Nimble's toEventually instead and make your tests as fast as possible.
Swift @Published properties come with an associated Combine Publisher that emits values over time. This free XCTest tutorial explains when to write a unit test that accesses the property directly and when it's instead necessary to subscribe to it using the sink operator.
I published a YouTube video with a tutorial on implementing the FizzBuzz algorithm using Test-Driven Development. While recording, I made a couple of thinking or coding mistakes, and, sure enough, the tests immediately pointed them out.
To test SwiftUI applications, don't test SwiftUI code. The SwiftUI framework doesn't lend itself to writing unit tests so don't try to shoehorn views in your test harness. Instead, split layout declaration form content generation logic.
My book, Test-Driven Development in Swift, is now available in online bookstores everywhere. You'll learn Test-Driven Development writing a real-world SwiftUI application, including events-flow management with Combine, networking, local storage, and third-party libraries.
A roundup of the testing-related new features announced at WWDC 2021. Including Xcode Cloud, how to test code using async/await, the new XCTExpectFailure and addTearDownBlock APIs, and the new Test Repetition configuration in Test Plans.
Swift 5.5 and Xcode 13 introduce the async/await pattern for concurrent code. This tutorial post shows how to write unit tests for asynchronous code in Swift using the XCTest framework.
Testing Swift date comparison code with XCTest can result in indeterministic tests because of the passage of time. To make tests robust and deterministic, decouple them from the system clock by injecting the reference date.
Working from home doesn't have to be lonely. Going from remote to distributed can bring massive benefits to employees satisfaction and company productivity.
When writing unit tests in Swift for complex objects, you may need to write a lot of setup boilerplate code in the arrange phase. Scenario Builders are a pattern that extracts and encapsulated all that logic in a single component with an English-like API. This tutorial shows how to build a Scenario Builder in Swift and looks at its pros and cons.
How to establish a workflow that minimizes unscheduled, unstructured communication and maximizes focus and productivity.
My latest post on mobile.blog explores two simple conventions Automattic uses to remove the need for synchronous meetings in their app release process.
How working your way backwards from your desired outcome can make you more productive, focused, and motivated.
Embrace boredom to train your brain to sustain focus when working on demanding tasks
Snippets to test the behavior of Combine Publishers in XCTest ready to copy and paste into Xcode
Camille Fournier encourages us to "Make Boring Plans" and move in small iterations.
This free tutorial shows how to migrate an existing app with SwiftUI life cycle to use UIKit App Delegate instead
The start of a new year is a great time to work on self-improvement, but unless you take the right steps, your New Year resolutions might not stick.
You can get the Swift compiler to generate an initializer with default values for your structs, if you're willing to put up with a bit of mutability.
The "You Don't Need It Yet" technique to ship software on a schedule results in fast real-world feeback. The same mindset can be applied with Test-Driven Development to move between the Red, Green, and Refactor stages faster.
The XCTest Swift testing framework has a limited offer of assertions. There's only so much you can do with XCTAssertTrue and XCTAssertEqual. This XCTest tutorial shows how to create custom assertions to make your unit tests and UI tests shorter and clearer.
Result is one of the most useful types in the Swift language. Learn how to write better unit tests using Result in this XCTest tutorial.
Scientist can learn a lot from failed experiments. To do so, they must be methodical and collect all sorts of information. Softwar developers can learn a lot from failures, too. What are the practicies that can make learning easier?
When merging a pull request on GitHub, it helps to replace the default merge commit title with the PR title or an equally descriptive one. This will make your Git history more informative, and developers will understand the changes in the Git log faster.
How to make the unit tests of your SwiftUI app safer and faster by preventing them from running the program startup flow. This will avoid all of the launch operations like network requests or reads from the local storage that would affect the global state.
There are many ways to rename a file in Vim. Here's three.
Here's a shell command to trim all the trailing whitespaces in all the files of the current folder.
Using Swift's nested types helps making it clear that a view model belongs to a view.
This post shows two ways of achieving dependency injection in SwiftUI: using @EnvironmentObject or a View Model Factory.
With his famous pipe wrench lecture, Vannevar Bush taught young MIT engineers the value of precision. The same teaching holds true for software developers.
Hyperfocus will teach you how to concentrate effectively and let your mind wander to reach creative insights.
YDNIY is a purposeful restraint of what you decide to build in the interest of delivering value to the users as soon as possible and consistently.
The most exciting phrase to hear in science, and software development, the one that heralds new discoveries, is not "Eureka!" but "That's funny…"
iOS 14 introduces Widgets, a feature that makes it incredibly easy to get distracted.
Triple-state Booleans can be ambiguous to work with. Replace them with an enum to make the code clearer.
When the output value of a function changes often but the logic to pick it doesn't, adding a separation layer will make unit tests easier to maintain.
If you focus on writing honest code, you'll end up with software that is easier to understand and work with.
An explanation of what referential transparency means with examples in Swift