turing complete with a stack of 0xdeadbeef

Writing

I mostly write about Swift, Objective-C, iOS, open source, and other software development topics. Sometimes I write about the ethics of tech, labor, and politics. I also write personal essays and notes on what I'm currently reading.

Fixing a hard-to-find bug in Dark Mode

15 July 2021

I previously wrote about implementing Dark Mode in an older codebase, specifically how Dark Mode works (or doesn’t) with CGColor. I recently fixed a bug in the same project that was difficult to track down because it manifested in such a strange way. After finding the problematic code, I realized that it is an extremely common scenario in iOS codebases — so you might have this bug in your code as well!

Continue…

Debugging a DiffableDataSource CellProvider

11 July 2021

I was recently working on a project that uses modern collection views on iOS — that is, using diffable data sources, snapshots, and cell providers. I hooked up all the components and my collection view was working, or so I thought. I started to notice some very odd, unpredictable behavior when the collection view was updated. Some of the time, the cells were updated correctly. Other times, I would see duplicates and missing data. Here’s what went wrong.

Continue…

Is SwiftUI ready?

01 July 2021

I’ve been following what’s going on with SwiftUI since it was released with iOS 13 at WWDC 2019 and have even taken extensive notes, but I have avoided using it. As I wrote before, I mainly wanted to avoid dealing with bugs and workarounds that might make me less productive compared to using UIKit, which I know quite well. I’m very interested in learning and using it, I’m just hesitant given some of Apple’s history, like early years of Swift. I have no doubt that SwiftUI will be the future of Apple platform development, the question is when that future will arrive. This year the framework is debuting its third major release in iOS 15. How far has SwiftUI come, and is it ready for building serious apps?

Continue…

RSS feeds, Jekyll, and absolute versus relative URLs

06 June 2021
Updated: 09 June 2021

Lately I’ve been upgrading and making improvements to my website and blog. As part of that work, I was updating and refining how my RSS feed gets generated with Jekyll. And then I realized something that I had not given much thought to previously. When including the full content of blog posts in an RSS feed, if you link to other posts or pages on your site should you be using absolute URLs or are relative URLs ok?

Continue…

To distribute in the Mac App Store, or not

Is the app sandbox worth it? 02 June 2021

For the past few weeks I have been debating on whether or not to distribute a new Mac app via the Mac App Store or independently. I have arrived at a crossroads in development where I need to make this decision. I am mostly code-complete for my MVP 1.0 release. The question I am facing is how I want to spend the remainder of my time to cross the finish line.

Continue…

iOS 14 App Library

01 June 2021

I think App Library is one of the best features added to iOS in the past few years. I’m not being sarcastic, I know some folks dislike it. However, I absolutely loathe trying to organize apps on my phone into folders, because many apps do not have a singular, definitive category.

Continue…

Three months of Big Sur

01 June 2021
Updated: 09 June 2021

I upgraded to Big Sur three months ago. I know I’m (fashionably?) late to this party, but here I am. This is the longest I have ever waited to upgrade macOS. It feels weird, considering WWDC is next week where we will see what is next for macOS. Big Sur still feels new to me, and announcing the next major release already feels too soon. I was avoiding Big Sur based on various reports about bugs and instability. There were not any ‘killer’ features I was eager to have, thus the main reason I upgraded was because Xcode 12.5 required it.

Continue…

Resources for learning SwiftUI

07 April 2021

A few months ago, I shared my notes and resources for learning about compilers and LLVM. It turned out to be pretty popular and folks seemed to find it useful. So I decided to do it again, but this time for SwiftUI. However, unlike learning about compilers and LLVM, I am not declaring bankruptcy with learning SwiftUI. While I have still not written a single line of SwiftUI code, I know I eventually will.

Continue…

Migrating OmniFocus to a new Mac

31 March 2021

One aspect of using OmniFocus involves maintaining an archive of your data (if you choose). Over time — think years of using OmniFocus as your main task management tool — your local database of projects and tasks will grow very large, because OmniFocus keeps a record of everything you have completed or dropped. You can think of it as archiving your emails instead of putting them in the trash.

Continue…

Returning to normal, Part 3

23 March 2021
Updated: 24 March 2021

After only five days, yet another mass shooting has happened in the US. This post follows Part 1 and Part 2 in this ongoing series documenting how the US is recovering from a life-threatening virus.

Continue…

Xcode tips for everyone

22 March 2021

Lately, it feels like every few days someone is sharing a new Xcode tip on Twitter or on their blog. They range from hidden settings to features I simply never knew about. I started saving links and planned to add a new “Xcode tips” section to my TIL repo on GitHub to reference later. But as I started, I realized that the resulting markdown file would not be easily discoverable or shareable. I thought, wouldn’t it be nice if the iOS and macOS developer community had a single place to find and share Xcode tips?

Continue…

Using pipes in Swift scripts

18 March 2021
Updated: 22 March 2021

I have a few Swift scripts to automate tedious tasks for maintaining my blog. I updated one today to use pipes. It took me a minute to figure out, because it did not feel very intuitive. I’m not sure if I feel that way because the interface is actually that clunky, or if I’m just inexperienced with Swift scripting. In any case, here’s how it works.

Continue…

Xcode UI testing reliability tips for iOS

17 March 2021
Updated: 18 March 2021

Xcode’s UI testing framework has had its ups and downs over the years. Most recently, it has been much more robust and reliable in my experience. However, tests still tend to flake sometimes. Here are some ways that I have been able to reduce flakiness in UI tests.

Continue…

Returning to normal, Part 2

17 March 2021

I did not expect that I would have to follow-up on yesterday’s essay so soon, but I can’t say I’m surprised. In the past 24 hours, there were two mass shootings in the US. It is shocking and horrifying, yet somehow entirely predictable.

Continue…

Deleting tweets and other social media content

16 March 2021

I have been periodically deleting my tweets for a while now. Yesterday, I finally found a reliable solution for deleting my Twitter “likes” as well and I spent some time deleting all of them. Long ago, I also deleted all of my content on Facebook and Instagram. If you are interested in purging your social media accounts, here are some options.

Continue…

Returning to normal

16 March 2021

Oakland has been anything but normal over the past year during the pandemic. But we are starting to see glimpses of normality. Little by little, the whole country is returning to “business as usual”, as they say. And the first real indication that normality is on the horizon for the US was a recent story out of Arkansas.

Continue…

A list of books I read in 2020

30 December 2020

Continuing my (still somewhat recent) tradition, here are the books I read in 2020. You can find previous years under the #reading-list tag. I really thought I was going to be able to read a lot more this year, but fuck this pandemic and fuck 2020 all around. There were many weeks where I simply could not focus on much of anything.

Continue…

Resources for learning about compilers and LLVM

28 December 2020

Today I cleaned up my various projects and todo’s in OmniFocus. I am always collecting links and resources for potential project ideas, or for general learning. Sometimes, however, it is best to acknowledge that I will likely never have enough free time to even begin some of these endeavors.

Continue…