在 Swift 1.2 中与 "Function signature '' is not compatible with expected type ''" 战斗

Fight with "Function signature '' is not compatible with expected type ''" in Swift 1.2

我收到消息:Function signature '(StatusUpload) -> ()' is not compatible with expected type '(status: StatusUpload) -> ()'。我做错了什么。

typealias StatusUpload = (fileNum: Int, totalFilesCount: Int, fileBytesUploaded: CUnsignedLongLong, fileBytesTotal: CUnsignedLongLong)

progress: ((status: StatusUpload)->())?
// ...
var newProgressClosure: ((status: StatusUpload)->())? = nil
if let progress = progress {
    newProgressClosure = {(status: StatusUpload)->() in
        var newStatus = status
        newStatus.fileNum++
        newStatus.totalFilesCount++
        progress(status: newStatus)
    }
}

删除来电者的status:

使用progress: ((StatusUpload)->())代替progress: ((status: StatusUpload)->())

这是为我打造的。

    typealias StatusUpload = (fileNum: Int, totalFilesCount: Int, fileBytesUploaded: CUnsignedLongLong, fileBytesTotal: CUnsignedLongLong)
    var progress : ((status: StatusUpload)->())?
    // ...
    var newProgressClosure: ((StatusUpload)->())? = nil
    if let progress = progress {
        newProgressClosure = {(StatusUpload)->() in
            var newStatus = status
            newStatus.fileNum++
            newStatus.totalFilesCount++
            progress(status: newStatus)
        }
    }