Tab Bar and UISearchController giving black screen

后端 未结 6 883
温柔的废话
温柔的废话 2021-01-07 20:36

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

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-07 21:10

    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"
                    }
    

提交回复
热议问题