Detect if UITableView is in startUpdates / endUpdates state

I am writing a small unit test for a UITableView and want to check if there was a call to the endUpdates method. In other words, I want to check that the UITableView is in a normal state, but not in an β€œupdate” state.

Is there a way (method, property or something else) that I can use to check the status of TableView?

I was thinking of a subclass, but it seems complicated for such a simple task.

+5
source share
1 answer

There is a built-in boolean to check if the tableView is in edit mode or not.

to check state use

if([tableView isEditing] == YES)
{
//enter code if in editing mode
}
else
{
//enter code for non editing mode
}

hope this helps. happy coding :)

-5

All Articles