Swift compiler today surprised me with new cool feature.. warning :
Backward matching of the unlabeled trailing closure is deprecated; label the argument with 'onSuccess' to suppress this warning
I use trailing closure syntax almost everywhere and I don't see where is the issue with this case.
Function is defined as this:
func send<Data>(operation: CSOperation<Data>, title: String, progress: Bool = true,
canCancel: Bool = true, failedDialog: Bool = true, onInternetFailed: (() -> Void)? = nil,
onSuccess: ((Data) -> Void)? = nil) -> CSProcess<Data> {}
It was called like this:
send(operation: model.server.downloadCensusDocument(), title: .page_thanks_confirmation_download) {
documentController = UIDocumentInteractionController(url: $0.url)
...
}
And compiler wants me to write it like this:
send(operation: model.server.downloadCensusDocument(), title: .page_thanks_confirmation_download, onSuccess: {
documentController = UIDocumentInteractionController(url: $0.url)
...
})
Any way to silence it, instead of stopping use of trailing closure ?