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?