Swift how to check if textfield exists in array at Index -


i new programming...

i know best way offline login page mysql users db (consists of usernames, passwords, id) 'downloaded' php script ios device.that part works, , users print console.

what struggling is, checking textfield user enters username 'usersarray' see if exists @ index[0]

any appreciated.

i'm not entirely sure trying here think trying take value of text field , see if value appears in usersarray. provided case try:

let exists = usersarray.contains(usernametextfield.text) 

this give bool indicates if username exists in array.

side note:

hopefully doing general testing @ moment in case aren't… please don't send passwords in plain text , absolutely don't download usernames , passwords in encrypted format device! aside potentially taking large amount of space on user's device making easy unscrupulous people crack every user password in database!


Comments