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?
Code Block
2021-03-08 01:54:30.113337-0500 sokyTasks[7745:616019] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
viewDidAppear(_:) going to loadData
loadData() going to buttonChange
buttonChange() button has changed
r_feedback(rtaskId:) queryFeedback
r_feedback(rtaskId:) going to reloadData
loadData() going to buttonChange
buttonChange() button has changed
r_feedback(rtaskId:) queryFeedback
r_feedback(rtaskId:) going to reloadData

I have discovered the issue and I would need help to come up with a best completion handler to resolve my problem.
As shown below, my r_feedback() function is exiting before new messages are appended therefore TableView.reloadData() is reloading old data because new data are added after.
My solution should be to force my TableView.reloadData() to be called only once my arrayFeedback.append has completed


Code Block
r_feedback(rtaskId:) exiting r_feedback
r_feedback(rtaskId:) arrayFeedback.append completed
r_feedback(rtaskId:) reload has completed

Could you show the present version of code, which includes the prints (as "exiting r_feedback")

Please don't forget to format with <> tool.
TableView relsoaddata from textField on the same viewController with TableView
 
 
Q