问:为什么 [Code]:guard name() else{ throw }, show "Missing argument parameter #1in call swift 2 xcode 7

Q: Why does [Code]:guard name() else{ throw }, show "Missing argument parameter #1in call swift 2 xcode 7

为什么它向我显示错误:"Missing argument parameter #1 in call"?

您的方法 isValidBirth 需要一个参数。您需要向该方法传递一个值,因此请更改您的代码:

guard isValidBirth(birthField) else
{
   throw Error.InvalidBirth
}