I have two scenes which can be accessed through a tab bar, on scene 1 there is a search bar. the problem that I am facing is that while searching if I switch to the download
What if you move this bit of code
self.activityIndicator.stopAnimating()
self.activityIndicator.hidden = true
to after your result? Like this:
// If the network works fine
if response.result.isFailure != true {
self.activityIndicator.stopAnimating()
self.activityIndicator.hidden = true
(if that works, you would also need to include it on the other side of your else too... )
// If the network fails
else {
self.activityIndicator.stopAnimating()
self.activityIndicator.hidden = true
self.retryButton.hidden = false
self.loadingMessageLabel.text = "Check your internet connectivity"
}