I have a UITableView
with static cells created in a storyboard. When the user touches a cell, another cell should hide/show. This is identical to how it looks in the built-in calendar app in iOS 7. It's basically the same question as this: How does one implement a view that slides out like the date picker in calendar? but I have a static table view and not a dynamic, otherwise the solution would have worked. If i try it, en exception is thrown.
As it is now, I can show and hide the cell at the row, but it is without animation, which isn't acceptable. This is the code I use:
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 2 && indexPath.row == 0)
{
NSIndexPath *dateIndexPath = [NSIndexPath indexPathForRow:1
inSection:2];
UITableViewCell *dateCell = [self.tableView cellForRowAtIndexPath:dateIndexPath];
if (dateCell.hidden)
{
dateCell.hidden = NO;
}
else
{
dateCell.hidden = YES;
}
}
}