I am making an simple chatting app and I want to update to the latest messages when the user logs in. Right now the collection view cells do not update to the newest messages even though i call self.collectionView.reloadData()
in ViewDidAppear
.
In my loginViewController
I have a function where i pop to the root view controller(inbox), and I don't know how I can update the data before it pops to the inbox. As i said I am calling self.collectionView.reloadData()
in the viewDidAppear
and it does not update. When I run on simulator I have to go to the compose screen and go back to inbox before it updates the messages.
func signUpViewController(signUpController: PFSignUpViewController, didSignUpUser user: PFUser) {
dismissViewControllerAnimated(true, completion: nil)
self.navigationController?.popToRootViewControllerAnimated(true)
}
Does anyone know a fix?