How to Create Password validation in iOS? -


this question has answer here:

i new ios, how create password validation in ios. in uitextfield allows numbers,one uppercase,lowercase , special characters. password length 8 characters. advance thank, examples.

if want validate password, in button click, mean after have typed password, , click button , want validation work---- how ---

create ibaction button---

-(void)validatewithbuttonclick:(id)sender{ nsstring *textfrompassword = _mypasswordtextfield.text; bool hasoneupper = no; bool hasonelower = no; bool hasonespecial = no; bool is8digit = no; if(pass.length >=8){     is8digit = yes; } (int =0; i<pass.length; i++) {     char c1 = [pass characteratindex:i];     if([[nscharacterset uppercaselettercharacterset] characterismember:c1]){         hasoneupper = yes;         continue;     }     else if ([[nscharacterset lowercaselettercharacterset]characterismember:c1]){         hasonelower = yes;          continue;     }     else if ([[nscharacterset symbolcharacterset]characterismember:c1]){         hasonespecial = yes;          continue;     } }   if(hasonespecial && hasoneupper && hasonelower && is8digit){     //validate password , progress.. } else {     //your password not according guidelines } } 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -