mickhsmith mickhsmith - 29 days ago 4
iOS Question

Allow user inteaction with UITextField in a CollectionView Cell

I've written an IOS App which uses

UITableViewCells
and I am converting it to use
UICollectionView Cells
.

It's working OK at present, but I can't figure out how to allow user to update a
UITextFied
which is situated within the
UICollectionView Cell
.

I've managed to do this with
UITableView Cells
.

I've searched for answers to my problem, but can't find anything that uses a
UITextField
within a
UICollectionView Cell
.
Help in pointing me in the right direction would be much appreiciated.

Answer

Can you show us some of the code you are using. I have used UITextFields in UICollectionViews without a problem, so I am not sure what your question is.

Edit:

First add a tag in storyboard or programatically to your textfield for this example we will use a tag of 2

Then every time you want to modify the textfield simply call

UITextField *myText = (UITextField *)[cell viewWithTag:2];
Comments