我想做一個IF/Else語句,只有當他輸入了正確的代碼時纔會授予用戶訪問權 - 例如,登錄 - 如果他將約翰史密斯放在用戶名文本框中,他會能夠按下登錄按鈕,否則,它將無法工作。我如何使Xcode的IF語句,使UIButton的工作?
這是代碼我有
if ([usernameText.text is EqualToString:@"jzarate"]) {
(insert code that grants functionality to the "log in button")
else ([insert code that does not grant functionality to the "log in button"])
我也想這樣做與由數字組成密碼相同