Created
January 24, 2017 14:51
-
-
Save matteodanelli/2412a7638cb63ceb3caffed73b7510fb to your computer and use it in GitHub Desktop.
UITableViewDataSource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func numberOfSectionsInTableView(in tableView: UITableView) -> Int { | |
return NUMBER_OF_SECTIONS | |
} | |
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return NUMBER_OF_ELEMENTS_PER_SECTION | |
} | |
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell(withIdentifier: "CELL_IDENTIFIER", for: indexPath) | |
// set cell's textLabel.text property | |
// set cell's detailTextLabel.text property | |
return cell | |
} | |
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
tableView.deselectRow(at: indexPath, animated: true) | |
// call action in select | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment