5
スウィフト4で私は、最小長とのUITextFieldのテキストの長さを比較しようとしている:バイナリ演算子 '> ='は 'String.IndexDistance?'型のオペランドには適用できません。 (別名「オプション<Int>」)と 'int型
if textFieldPassword.text?.count >= 8 {
}
しかし、私はエラーを取得しています
Binary operator '>=' cannot be applied to operands of type 'String.IndexDistance?' (aka 'Optional<Int>') and 'Int'
皮肉なことに、それは
textFieldPassword.text?.count == 8
で動作します誰かが私を助けることができますか?
おかげヴァディアン、私はあなたの答えを受け入れます –