As I read through the UIKit
, most of the time I see closures (as a function parameter) with missing argument labels like this: func fooClosure(fooClosure: (Bool) -> Swift.Void)
In some cases I can guess what it stands for, in others I can't.
Example:
Take a look at one of UIActivityViewController
's closure (as a type alias):
public typealias UIActivityViewControllerCompletionWithItemsHandler = (UIActivityType?, Bool, [Any]?, Error?) -> Swift.Void
What does 3rd type stand for? I have to look at the Objective-C version of the code to know these are returnedItems
.
Why it is not implemented that way: (note the activityItems
label)
public typealias UIActivityViewControllerCompletionWithItemsHandler = (UIActivityType?, Bool, _ activityItems: [Any]?, Error?) -> Swift.Void
Edit: - Is this just a temporary state (since the Swift is not fully integrated in these frameworks yet)? Code is less readable without argument labels.