App intermittently freezing in transition (2 top level UIWindows)
<p>My app freezes intermittently in transition. Upon managing to get it frozen while in debug mode, we paused it and took screenshots. Some notes:</p>

<ul>
<li>in frozen state, the CPU was still reacting to taps, so it is still responding in some way</li>
<li>looking at the threads, it appeared that there is no infinte loop, heavy function, or whatsoever.</li>
</ul>

<p>However, looking at the UI ViewHierarchy surfaced an intersting thing - there were 2 top level UIWindows, with the top one being completely empty, and the button one overlayed by transition views.</p>

<p>What is the likely culprit here? My code included below the screenshots:</p>

<blockquote>
  <p>Threads do not appear to be doing nothing 
  <a href="https://i.stack.imgur.com/Cnaxf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cnaxf.jpg" alt="enter image description here"></a></p>
  
  <p>First of the 2 UIWindow (blank)
  <a href="https://i.stack.imgur.com/vqm0z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vqm0z.png" alt="enter image description here"></a></p>
  
  <p>Second of the 2 UIWindow
  <a href="https://i.stack.imgur.com/fm9hi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fm9hi.jpg" alt="enter image description here"></a></p>
</blockquote>

<pre><code>  // view controller
  func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    let question = dataAccessor.objectAtIndexPath(indexPath)
    delegate?.feedViewControllerDidSelect(self, question: question)
    tableView.deselectRowAtIndexPath(indexPath, animated: true)
  }

  // delegate for viewcontroller
  func feedViewControllerDidSelect(viewController: FeedViewController, question: Question) {
    let questionDetailViewController = QuestionDetailViewController.create(question, delegate: self)
    navigationController.pushViewController(questionDetailViewController, animated: true)
  }


  // Question Detail View
  static func create(question: Question, delegate: QuestionDetailViewControllerDelegate?) -&gt; QuestionDetailViewController {
    let vc = StoryboardScene.QuestionDetail.instantiateQuestionDetailVC()
    vc.question = question
    vc.delegate = delegate
    return vc
  }
</code></pre>