Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to determine if user pressed/selected a uitextfield?

Tags:

xcode

iphone

Is there a way to determine if a user has selected a textfield and its active? I'm trying to implement some code this:

if(textFieldsomething.isActive)
{

}
like image 553
user648244 Avatar asked Mar 29 '11 18:03

user648244


People also ask

What is UITextField in Swift?

An object that displays an editable text area in your interface.


1 Answers

You can check to see if the text field is editing:

if (textFieldSomething.isEditing) {
    ...
}

See the UITextField class reference for details.

like image 137
Greg Avatar answered Nov 11 '22 03:11

Greg