New: Implement missing indexPath method for CPTreeNode (#2999)

This commit is contained in:
David Richardson authored and GitHub committed 2021-11-23 13:45:10 +01:00
1 parent ccc6007bab
commit b66690e304
1 file changed
+25
+25
View File
@@ -50,6 +50,31 @@
return self;
}
- (CPIndexPath)indexPath
{
if (_parentNode != nil)
{
var path;
var index;
index = [[_parentNode childNodes] indexOfObject:self];
path = [_parentNode indexPath];
if (path != nil)
{
return [path indexPathByAddingIndex:index];
}
else
{
return [CPIndexPath indexPathWithIndex:index];
}
}
else
{
return nil;
}
}
- (BOOL)isLeaf
{
return [_childNodes count] <= 0;