Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose header of table view to allow setting search bar #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions LNZTreeView/LNZTreeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,21 @@ public class LNZTreeView: UIView {
get {
return tableView.keyboardDismissMode
}
set{
set {
tableView.keyboardDismissMode = newValue
}
}

public var tableViewRowAnimation: UITableView.RowAnimation = .right

public var headerView : UIView? {
get {
return tableView.tableHeaderView
}
set {
tableView.tableHeaderView = newValue
}
}

var nodesForSection = [Int: [MinimalTreeNode]]()

Expand Down Expand Up @@ -476,7 +485,7 @@ extension LNZTreeView: UITableViewDelegate {
}

public func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
guard var nodes = nodesForSection[indexPath.section],
guard let nodes = nodesForSection[indexPath.section],
let indexInParent = self.indexInParent(forNodeAt: indexPath) else {
fatalError("Something wrong here")
}
Expand Down