Created
July 1, 2018 11:02
-
-
Save emrepun/0e3dc73f637def50633ef81cdd738840 to your computer and use it in GitHub Desktop.
random func
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
func numberOfSections(in tableView: UITableView) -> Int { | |
return 1 | |
} | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return userArray.value.count | |
} | |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
guard let cell = tableView.dequeueReusableCell(withIdentifier: "cell") else { | |
return UITableViewCell() | |
} | |
cell.textLabel?.text = userArray.value[indexPath.row].name | |
return cell | |
} | |
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
userToShowInFirstVc.value = userArray.value[indexPath.row] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment