Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Augustyniak/RATreeView
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: lightyear/RATreeView
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jun 19, 2014

  1. Handle nil return from willSelectRowForItem:

    UITableView allows its matching delegate method to return nil and interprets this as “don’t change the selection”. Returning nil from RATreeViewDelegate doesn’t work the same. A nil return didn’t propagate up as nil, instead being transformed into a re-selection of the current item, with the corresponding delegate calls.
    sjmadsen committed Jun 19, 2014
    Copy the full SHA
    e212e42 View commit details
Showing with 6 additions and 2 deletions.
  1. +6 −2 RATreeView/RATreeView+TableViewDelegate.m
8 changes: 6 additions & 2 deletions RATreeView/RATreeView+TableViewDelegate.m
Original file line number Diff line number Diff line change
@@ -83,8 +83,12 @@ - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NS
if ([self.delegate respondsToSelector:@selector(treeView:willSelectRowForItem:treeNodeInfo:)]) {
RATreeNode *treeNode = [self treeNodeForIndex:indexPath.row];
id item = [self.delegate treeView:self willSelectRowForItem:treeNode.item treeNodeInfo:[treeNode treeNodeInfo]];
NSIndexPath *delegateIndexPath = [self indexPathForItem:item];
return delegateIndexPath.row == -1 ? indexPath : delegateIndexPath;
if (item) {
NSIndexPath *delegateIndexPath = [self indexPathForItem:item];
return delegateIndexPath.row == -1 ? indexPath : delegateIndexPath;
} else {
return nil;
}
} else {
return indexPath;
}