Post

Replies

Boosts

Views

Activity

TableView relsoaddata from textField on the same viewController with TableView
I have a viewController that has tableview that is updated from Parse Server. My query and reload data function is under override func viewDidAppear( animated: Bool) {         super.viewDidAppear(animated)         loadData() // this is my function that queries and reloads data     } I have also a textField from which a message is captured updates the database and calls loadData() as follows: @IBAction func composeButton( sender: Any) {         //inputAlert()                  if (feedInputField.text != "" ) {         let reqType = Int(reqTypeIndex.text ?? "") ?? 0          AddFeedbacks(message: feedInputField.text ?? "", taskId: idTask?.text ?? "", atype: reqType)          loadData()         feedInputField.text = ""         }     } Problem : When the app first loads, it loads existing messages in the database. And if I add a new message from the feedInputField, the tableView is not updated but if I added a second message, it then displays both messages. From there, it starts updating normaly. The issue is only when i load the app and after that it works. My question what is the issue?
18
0
1.5k
Feb ’21