Typed Filters and callAsFunction

Swift is full of syntactic sugar. One particular taste of sweet is the callAsFunction feature. If a type has a method of that name, you can call an instance or value of that type like a function. That’s used in SwiftUI to pass actions around in the environment, for example. Quick demo: See how the call looks like there’s a function updateWidgets(newerThan:) but actually it’s calling the value itself?

Continue reading …

Fairphone Fairbuds Are a Great Idea (Only)

I wanted to write something positive about the Fairphone Fairbuds. Here it is: They are a great idea. That’s it. Please move on. Continue reading for gory details, but this really sums it up: Replaceable batteries at the cost of a larger form factor is a tradeoff I am absolutely willing to make and advocate for. I hope more companies try this in our greener future.

Continue reading …