Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TableViewTutorial01
import UIKit
class ViewController: UIViewController {
// MARK: - IBOutlets
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//1 - TableView delegate e datasource
self.tableView.delegate = self
self.tableView.dataSource = self
//2 - TableView register class
self.tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "tableCell")
}
override func viewWillAppear(_ animated: Bool) {
//3 - TableView reload
self.tableView.reloadData()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.