title: UIRefreshControl stucks only in iPhone X/ iPhone XR
body: <p>I am working on an application where I implement UIRefreshControl. All things going fine but when testing move on iPhone X or iPhone XR, pthen a weird problem raised.</p>
  
  <p><strong><em>The problem is UIRefreshControl Stucks sometimes when we try to refersh the list. Or we can say it occurring 1 out of 10 cases, If we uses it continuously. This issue is only generating in iPhone X or XR. In other device everything works fine.</em></strong></p>
  
  <p>If we talk about the code, I used the code which works perfectly. Here is a code snippet for UIRefreshControl.</p>
  
  <p>Initialization:</p>
  
  <pre><code>lazy var refreshControl: UIRefreshControl? = {
      let refreshControl = UIRefreshControl()
      refreshControl.addTarget(self, action:#selector(refreshAssignmentData(_:)),  for: .valueChanged)
      refreshControl.tintColor = CustomColors.themeColorGreen
      return refreshControl
  }()
  </code></pre>
  
  <p>I call this func in API, so when I get response it will add.</p>
  
  <pre><code> func addRefreshControl() {
      /// Here adding refresh control
      if #available(iOS 10.0, *) {
          self.tblView?.refreshControl = self.refreshControl
      } else {
          self.tblView?.addSubview(self.refreshControl!)
      }
      refreshControl?.alpha = 1
   }
  </code></pre>
  
  <p>And when we use pull to refresh this method calls</p>
  
  <pre><code>@objc func refreshAssignmentData(_ sender: Any) {
      DispatchQueue.global(qos: .background).async {
          self.performSelector(inBackground: #selector(self.getNewAssignmentListInBackground(_:)), with: nil)
      }
          DispatchQueue.main.async {
              self.arrAllAssignment?.removeAll()
              self.arrAllAssignment = [AssignmentModel]()
              self.intPage = 1
          }
          DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
              self.refreshControl?.endRefreshing()
          }
  }
  </code></pre>
  
  <p>All these lines of code working fine in other device range except iPhone X series. </p>
  
  <p>Any suggestion please...</p>