Created
May 9, 2019 14:24
-
-
Save e-sung/6d3af00964c65b94a28ae3aa8df7695d to your computer and use it in GitHub Desktop.
This file contains 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
class SmileyDataSource: NSObject, UITableViewDataSource { | |
var dataList: [String] = [] | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return dataList.count | |
} | |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let item = dataList[indexPath.row] | |
let cell = tableView.dequeueReusableCell(withIdentifier: "smileyCell", for: indexPath) | |
cell.textLabel?.text = item | |
return cell | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment