Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
Fixes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
okhanokbay committed Apr 14, 2020
1 parent 11c6881 commit df37fd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 8 additions & 0 deletions Example/ExpyTableView/BasicExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ extension BasicExampleViewController: ExpyTableViewDataSource {
cell.labelHeader.text = "Section: \(section) Row: 0"
return cell
}

func tableView(_ tableView: ExpyTableView, canExpandSection section: Int) -> Bool {
return ExpyTableViewDefaultValues.expandableStatus
}
}

//MARK: Basic Table View Implementation, no need to write UITableViewDataSource because ExpyTableViewDataSource is forwarding all the delegate methods of UITableView that are not handled by itself.
Expand Down Expand Up @@ -89,6 +93,10 @@ extension BasicExampleViewController: ExpyTableViewDelegate {

print("DID SELECT row: \(indexPath.row), section: \(indexPath.section)")
}

func tableView(_ tableView: ExpyTableView, expyState state: ExpyState, changeForSection section: Int) {
print("Current state: \(state)")
}
}

class FirstTableViewCell: UITableViewCell {
Expand Down
10 changes: 0 additions & 10 deletions ExpyTableView/Classes/ExpyAbstractions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ public enum ExpyActionType {
func tableView(_ tableView: ExpyTableView, expandableCellForSection section: Int) -> UITableViewCell
}

public extension ExpyTableViewDataSource {
func tableView(_ tableView: ExpyTableView, canExpandSection section: Int) -> Bool {
return ExpyTableViewDefaultValues.expandableStatus
}
}

@objc public protocol ExpyTableViewDelegate: UITableViewDelegate {
func tableView(_ tableView: ExpyTableView, expyState state: ExpyState, changeForSection section: Int)
}

public extension ExpyTableViewDelegate {
func tableView(_ tableView: ExpyTableView, expyState state: ExpyState, changeForSection section: Int) {}
}

0 comments on commit df37fd4

Please sign in to comment.