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)
哇不知道如何這並沒有發生在我作爲一個選項。謝謝,會接受。 –