-6

||我应该如何在 Swift 3 中使用使用 OR 运算符的 If 语句

if (oName.text="" || oWeight.text="")
{
    print("Field Empty")

}
4

1 回答 1

11

您正在分配而不是检查相等性...

if (oName.text == "" || oWeight.text == "") {
    print("Field Empty")
}
于 2017-01-06T12:46:39.907 回答