1
说外部PARAM名字我有一个enum
:不要求枚举关联值
enum TextFieldRule {
case MinLength(length: Int)
case MaxLength(length: Int)
case MatchesOtherTextField(textField: UITextField)
}
这可以被称为:
.MinLength(length: 1)
有没有一种方法,使外部PARAM NAME不需要?因此,像:
enum TextFieldRule {
case MinLength(_ length: Int)
case MaxLength(_ length: Int)
case MatchesOtherTextField(_ textField: UITextField)
}
,并呼吁有:
.MinLength(1)
哇不知道如何这并没有发生在我作为一个选项。谢谢,会接受。 –