5
斯威夫特4我想的也是UITextField的文本的長度具有最小長度比較:二元運算符'> ='不能應用於類型'String.IndexDistance?'的操作數(又名「可選<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
有人可以幫助我的作品?
感謝vadian,我會接受你的答案 –