How to insert a row in UITableView with reloadData in iOS?

Hi Friends,

Good Day!

After a long time am come back with new information. Yes we all know very well to insert and add rows in UITableView.
I faced one scenario while my development that was to insert a last row in UITableView without reload it. Yes i have done with the new flow.
Am going to share that simple code with your all for your reference

Before that we have to read about UITableView from here.

First we have to take the indexpath using your data count which is stored in NSMutableArray, NSArray or something else.

NSArray *indexPathArray = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:[messagesArray count] inSection:0];

messagesArray is my NSMutableArray.

Now am going to add new data in my messagesArray from UITextView text.

[messagesArray addObject:messageTextView.text];

Now am going to update the tableview,

[messagesTableView beginUpdates];

And now am going to insert new row in the selected indexpath,

[messagesTableView insertRowAtIndexpaths:indexPathArray withRowAnimation:UITableViewRowAnimationTop];

After that finally just terminate the tableview updation,

[messagesTableView endUpdates];

Above the way i was used to update the UITableView without Reloading it. I hope it will help you little bit.
If you feel anything about this jsut let me know. Am waiting for your thoughts. Thanks.

Happy Coding

Warm Regards,
Yuvaraj.M