RATreeView
RATreeView copied to clipboard
Expand/Collapse only when tap on button not on cell touch
hey @Augustyniak nice library but i don't want to expand/collapse on cell touch but i want to expand/collapse tap on button putted right side in cell. Any help Thank you.
@girishghoda you can achieve this by
- Disabling selection of cells for RATreeView:
treeView.allowsSelection = false
- and then manually expand/collapse cell on a button touch:
// Check current expand/collapse state of cell
let isExpanded = treeView.isCell(forItemExpanded: item)
// Expand or collapse cell
if isExpanded {
treeView.collapseRow(forItem: item, collapseChildren: true, with: RATreeViewRowAnimationAutomatic)
} else {
treeView.expandRow(forItem: item, expandChildren: false, with: RATreeViewRowAnimationAutomatic)
}
treeView.allowsSelection = false
will disable click into cell