1
votes

i need help please. How to add new textfield on uiview or row in uitableview when my custom UIbutton on view is tapped. The scenario like contact app in iphone when user want to add new phone number.

Like this picture

All content in row or textfield can be edited by user, and the data will be save if user tapped save button on navigation bar.

1

1 Answers

0
votes

Instead of reload tableview, you should use beginUpdates() and endUpdates() for tableview.It would be much better approach..

First of all append data in your tableview array on button click

Yourarray.append(" data")  

Then update your table and insert new row

   tblname.beginUpdates()
    tblname.insertRowsAtIndexPaths([
        NSIndexPath(forRow: Yourarray.count-1, inSection: 0)
        ], withRowAnimation: .Automatic)
    tblname.endUpdates()