Hard won lessons – Swift Type Checker
The root cause of a warning “Unable to type-check this expression” is not always inside the source file where it appears. I made a typo in computed property in a model object that caused the entire body to fail on the main screen.
After breaking it up into dozens of pieces trying to isolate the problem, it appeared as a different, still confusing error. But that error lead to the fix - changing a computed property from an optional into an Int.
In hindsight I should have just kept commenting out sections of the body until I’d isolated the culprit, rather than break it into sub-expressions.
I made a new thing! A simple way to add basic logging and Instrument tracking.
There are countless ways to get started with logging, and this one is my quick-start preference.
Add the file to any module, and it sets up a basic logger and signposts (visible in Instruments.) Instructions for each item’s call site are in the comments.
A general purpose global logging and signpost configuration file
An excellent video covering Xcode Terminology from Stewart Lynch.
Want to read: The Ten Thousand Doors of January by Alix E. Harrow 📚
Currently reading: The Demon of Unrest by Erik Larson 📚
Just finished re-reading: Bad Monkey by Carl Hiaasen 📚. Getting ready for the AppleTV+ show later this summer.
2024 WWDC Notebook
👀 Run, Break, Inspect: Explore effective debugging in LLDB is excellent. Developer App and YouTube
👀 What’s New in Swift. Developer App and YouTube
👀 Analyze Heap Memory is a dive into the sometimes esoteric but vital to understand topic of memory. Developer App and YouTube.
👀 Explore Swift Performance is a tour de force by the amazing John McCall. Keep re-watching and learning until it makes sense. Developer App and YouTube.
👀 Create a Custom Store with SwiftData. Don’t miss this if you want to store data in your app in a JSON file. Developer App and YouTube.
👀 SwiftUI Essentials. This video is incredible. I didn’t watch it until late June. It is perhaps the best overview of SwiftUI I have ever seen. Developer App and YouTube.
More to come…
Developer Toolkit
A mix of tools I use every day, and tools I’ve found useful. Many of these are in SetApp.
Primary
Xcode Apple’s IDE (don’t overlook Instruments!)
BBEdit Bulletproof Text Editor
DevUtils JSON validator and much more
JuxtaCode Diffs and Merge tool
Carbon Copy Cloner Local Backup
Tower My fav GitHub client, for nostalgic reasons mostly. Xcode 15 does what I need. Tower is expensive but useful for newbies because of its extensive help and support.
Secondary
Swift Playgrounds Experiment here!
Glance Quick Look Code Files in the Finder
Bakery Icons for Dev versions
GitHub Desktop Free! Excellent GUI. Does what you need.
RocketSim Add-on for Xcode iOS Simulator
Essential Editors JSON, Plist, and CSV editors
Networking
Proxyman Reveal HTTP Network Traffic
RapidAPI for Mac Formerly MacPaw. API tool
Special Projects
Nova Panic’s code editor
GitFinder GitHub in the Finder
EditKit Pro Xcode Extension
XCOrganizer Tag Xcode project files
Docs/Snippets
Dash Docs
A Companion for SwiftUI A menu of SwiftUI components
Libraried: UI Components iPad, although works on Mac
SnippetsLab Code Snippet Library
TeaCode Code Snippet Library
Design
DetailsPro macOS and iOS
Adaptivity macOS and iOS
Mock-up UI wireframe and prototyping design tool. macOS and iOS
And lastly, finished: Beyond the Blue Event Horizon by Frederik Pohl 📚
Still another vacation read: The Last Mile by David Baldacci 📚
Vacation Read Number 2: Finished Memory Man by David Baldacci 📚
Great walk down memory lane on the latest episode of ATP. I forgot I had a Netcom account!
It also made me think of my very first hard disk, circa 1985 or ‘86, amid tales of swapping disks between the system and the data.
Just finished another re-read in audio form: Native Tongue by Carl Hiaasen 📚
Almost made me miss the mess that is the keys. Almost.
Memory Lane
My early programming steps were taken on a Sharp EL5100 and not long after, an HP41CV.
Before the Sharp was my trusty (unprogrammable) TI-30.
Another memory, remember Dektol?
Solved: The Mysterious Flickering Background Blur on Zoom
A very subtle Mac interface choice combined with a cross platform app adds up to trouble.
This is what happened. On a recent Zoom call, my video background flickered in and out of focus randomly. The effect was not the same as applying a background blur in Zoom. It might also look like focus hunting, but it isn’t. It is a subtle – far less intense than Zoom’s default blur – effect applied somewhere between the camera and the output.
The suspects: Reincubate Camo, Zoom, macOS Ventura, and an iPhone 14.
The effect only appeared on the Zoom call and in the Zoom preferences preview window. The preview in Camo had the same blur, but did not flicker.
I’ll skip the dead ends and describe the solution.
This can only be fixed when the iPhone is connected and on.
Open the Sidebar Control Center on the Mac and disable any Video Effects and the problem dissappears.
Do not bother looking in Camo. Don’t look at the FaceTime app preferences, or its menus, or in System Settings. Sadly, the latter probably deserves a warning label: “*some system-wide settings are located elseware.”
Evidently the preferences that disable this behavior only appear in one place, and only during live video.
Its unclear in my testing if the effect can quietly enable itself due to a background sync or some other event. But the problem has been appearing and dissapearing since switching to Ventura. The frequency was so irregular that it took well over a month to puzzle out a solution.
As a result, a visit to the Control Center appears on my pre-Zoom checklist, in the hope of sparing my future Zoom callers any more eye strain, and me any more embarassment.
One reason this problem was so challenging to puzzle out: given that Background Blur is a feature, and given that Apple does not even use the term in favor of Portrait Mode, its searchability is low.
I hope this post finds its way to another who might be searching for help with the same behavior.
Currently re-reading: The Moon Is a Harsh Mistress by Robert A. Heinlein 📚
Currently re-reading: Where Wizards Stay Up Late by Katie Hafner 📚