From 928226dd0d0c76b0208418d62de758fe4670a0ac Mon Sep 17 00:00:00 2001 From: invisible66 Date: Tue, 12 Apr 2016 14:40:31 +0300 Subject: [PATCH] When Clicked Expandable Row While Another Row Expanded --- SKSTableView/SKSTableView.m | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/SKSTableView/SKSTableView.m b/SKSTableView/SKSTableView.m index 50992f7..494cf60 100755 --- a/SKSTableView/SKSTableView.m +++ b/SKSTableView/SKSTableView.m @@ -320,21 +320,21 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath [cell accessoryViewAnimation]; } - } - - if ([_SKSTableViewDelegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) - { - NSIndexPath *correspondingIndexPath = [self correspondingIndexPathForRowAtIndexPath:indexPath]; - - if (correspondingIndexPath.subRow == 0) - { - [_SKSTableViewDelegate tableView:tableView didSelectRowAtIndexPath:correspondingIndexPath]; - } - else + }else{ + if ([_SKSTableViewDelegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) { - [_SKSTableViewDelegate tableView:self didSelectSubRowAtIndexPath:correspondingIndexPath]; + NSIndexPath *correspondingIndexPath = [self correspondingIndexPathForRowAtIndexPath:indexPath]; + + if (correspondingIndexPath.subRow == 0) + { + [_SKSTableViewDelegate tableView:tableView didSelectRowAtIndexPath:correspondingIndexPath]; + } + else + { + [_SKSTableViewDelegate tableView:self didSelectSubRowAtIndexPath:correspondingIndexPath]; + } } - } + } } else {