How-to: Create compile time reminders in Xcode
Sep 14, 2021, 12:00 AM
Workarounds are a fact of life for programmers. You rarely have the ability to fix all the buggy code you have to work with, and even if you do, it might not be worth the time and effort to find and validate a proper fix. But while a...
How-to: Create a zip file on iOS using Swift without 3rd party dependencies
Feb 25, 2021, 12:00 AM
Getting the files your app stores on the device back out so you can look at them for debugging or similar is not as easy as it could be. There’s a number of filebrowser libraries out there, but it’s a bit overkill or occasional use and...
Reference: Obscure UserDefaults That Affect AppKit Behavior
Oct 16, 2020, 12:00 AM
Setting these UserDefaults in your app’s domain will change AppKit behavior at runtime.
NSDisplayCycleLoggingEnabled (h/t @pilky)
NSTextViewAvoidLayoutWhileDrawing: Disables a fastpath that allows layout passes to happen while...
How-to: Disable automatically organizing files on disk after move in Xcode project
Sep 28, 2020, 12:00 AM
Starting with Xcode 9 or so, Xcode by default keeps the on-disk layout of a project in sync with what you see in the Project Navigator. So when you move a file from one group to another, it will be moved between the respective folders on...
How-to: Reset Privacy Permissions in macOS
Mar 3, 2020, 12:00 AM
If you’re having issues with the privacy permissions system in macOS Catalina or newer versions, such as being unable to change the settings, there are several steps you can take to remedy the situation.
These settings are currently stored...
Reference: Obscure iOS Simulator Setings
Feb 12, 2020, 12:00 AM
There are a number of iOS simulator settings that are either completely undocumented or only mentioned in passing in release notes, so I’ll try to put them here as I come across them in order to make easier to find. Shoutout to Twitter for...
JSON validation bug in MariaDB 10.4.8 when Unicode escaping is used
Jan 21, 2020, 12:00 AM
It finally happened to me. A user entered an emoji into an input field, and a production system broke.
I don’t want to get into the weeds of the particular system, except to say that it’s a strictly ordered queue that couldn’t move...
Reference: Swift Error Catch Syntax
Oct 5, 2019, 12:00 AM
Below is some example code that covers common patterns for catching specific types of errors. This code is valid for Swift 5.1. I figure this might be useful for some folks since the official documentation doesn’t provide examples for all...
Reference: UIApplicationDelegate method invocation order (iOS 12)
Mar 14, 2019, 12:00 AM
This post serves as a guide for the order in which application delegate methods are invoked in response to certain actions on iOS.
This information is current only for iOS 12.1 unless indicated otherwise.
How-to: Preflight possible universal links before opening SFSafariController
Feb 22, 2019, 12:00 AM
h/t to @jnadeau
Before you open a URL in SFSafariController or any other browser, you should check if it’s a universal link, and if so, open it in the respective native app instead. It’s a good way to improve the user experience since...
Visual Reference: UIKeyboardType (iOS 12)
Dec 7, 2018, 12:00 AM
Here’s a visual overview of all UIKeyboardTypes as of iOS 12, including some alternatives for keyboards with non-ASCII numbers, like Hindi.
WWDC 2018 followup
Jul 5, 2018, 12:00 AM
I was able to attend WWDC this year and had a chance to talk to Apple engineers about a few issues I’ve been dealing with.
Deferred location updates unavailable
Deferred location updates are a feature of CLLocationManager where you can...
How-to: Decreasing iOS App size by moving from dynamic frameworks to static libraries with Cocoapods
Jun 6, 2018, 12:00 AM
With the release of Cocoapods 1.5, you can now compile all your pods as static libraries, even if some or all of them use Swift. This means that instead of building them as dynamic frameworks which are loaded when your app launches, the...
How-to: Creating Custom Smart Banners for iOS Apps Using Universal Links
Mar 11, 2018, 12:00 AM
A client recently asked me to help them implement a custom smart banner solution, inspired by what some other major companies in their industry were doing. I’m going to cover some of the related techniques and features first, before going...