There are a lot of instances of calling types as functions in SwiftUI.
When the DismissAction
environment object is obtained using @Environment(\.dismiss) var dismiss
, it is not a function. It is actually a type that implements a function called callAsFunction. The Swift compiler will take any function with this name, w…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.