Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
- @IBOutlet weak var tableView: UITableView!
- func numberOfSections(in tableView: UITableView) -> Int {
- return 1
- }
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return 2
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- return tableView.dequeueReusableCell(withIdentifier: "CellOne", for: indexPath)
- }
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- print("Selected the row")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement