mickhsmith mickhsmith - 11 months ago 66
iOS Question

Allow user inteaction with UITextField in a CollectionView Cell

I've written an IOS App which uses

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
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
within a
UICollectionView Cell
Help in pointing me in the right direction would be much appreiciated.

Answer Source

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.


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];