Hi mdoor,
I looked into this, and one way is to move the searchForUsers into viewWillAppear, so:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
Service.shared.searchForUsers { (response) in
switch response {
case .failure(let error):
print("Failed to find users:", error)
case .success(let users):
self.items = users
self.collectionView.reloadData()
}
}
}
But I don't know if Brian is referring to something a bit more slicker than this i.e. refreshing only the user that had changed maybe, as opposed to this solution which refreshes the whole view, even though it would only ever be one user. I will look into this and see if that can be done.