Skip to content

Instantly share code, notes, and snippets.

@zontan
Created July 6, 2020 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zontan/48678bb18c5611fd39ee62fe95b24fed to your computer and use it in GitHub Desktop.
Save zontan/48678bb18c5611fd39ee62fe95b24fed to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let user = currentUser, let friendID = resultsArray[indexPath.row]["uid"] {
friendsRef.child("\(user.uid)/\(friendID)").setValue("true")
if let userCell = tableView.cellForRow(at: indexPath) as? UserTableViewCell {
UIView.animate(withDuration: 0.2) {
userCell.detailLabel.alpha = 1
}
}
}
tableView.deselectRow(at: indexPath, animated: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment