Skip to content

Commit

Permalink
Cell selection example
Browse files Browse the repository at this point in the history
  • Loading branch information
srdanrasic committed Oct 7, 2018
1 parent 6b75ec0 commit 99b13d5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Bond
import ReactiveKit

let tableView = UITableView()
tableView.frame.size = CGSize(width: 300, height: 300)
tableView.frame.size = CGSize(width: 300, height: 600)

// Note: Open the assistant editor to see the table view
PlaygroundPage.current.liveView = tableView
Expand All @@ -34,4 +34,9 @@ DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
data.replace(with: ["W", "D", "X"], performDiff: true)
}

// Handle cell selection
tableView.reactive.selectedRowIndexPath.observeNext { (indexPath) in
print("selected row", indexPath)
}

//: [Next](@next)

0 comments on commit 99b13d5

Please sign in to comment.