Apple tells us not to use hard-coded colours like .black, but sets the default for scrolling text views to .black, causing text to be rendered in black on dark grey when in Dark Mode. Here’s a simple and universal fix.
Why did accessing a popup menu suddenly start throwing an exception? And why doesn’t a super call handle this? Another Swift mystery solved.
Adding sub-commands to write the contents of textboxes to the pasteboard: a simple task, but so easy to get hopelessly lost in it.
Want a non-sandboxed app to install itself in Login Items? Here’s a simple way without using a helper app.
Adding a WebKit browser window is straightforward so long as you ignore what Apple tells you.
Telling what a file is – whether plain text, Unicode UTF-8, 32-bit code, and so on – can be hard. Just use a little magic, free in the command tool ‘file’. Includes Swift code to access magic numbers.
Want a script app that takes dropped files/folders, does something to them, and saves them? Here’s a simple prototype project which does exactly that. Free to use.
Creating and resolving Finder aliases is straightforward in Swift: here’s how alisma does it.
Robust example Swift code for checking the free space available on a volume. A good quick check to run before trying to write out anything hefty.
A hard to spot runtime error results if you try to embed the key < in a dictionary. But when converting plain text for embedding in XML, that's one character you need to substitute.