Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- let valueToPass = jobs[indexPath.row].text; jobs[indexPath.row].addedByUser<- ERROR; jobs[indexPath.row].like(); jobs[indexPath.row].dislike()
- performSegue(withIdentifier: "toDetails", sender: valueToPass)
- }
- class Job {
- var text: String = ""
- var addedByUser: String!
- init(text: String, addedByUser: String) {
- self.text = text
- self.addedByUser = addedByUser
- }
- init(snapshot: DataSnapshot){
- if let value = snapshot.value as? [String : Any] {
- text = value["text"] as! String
- addedByUser = value["addedByUser"] as? String
- }
- }
- func toDictionary() -> [String : Any] {
- return [
- "text" : text,
- "addedByUser" : addedByUser,
- ]
- }
- }
Add Comment
Please, Sign In to add comment