title: Swift Unbalanced calls to begin/end appearance transitions for
body: <p>This has been stumping me for a while now. I have a <code>UISplitViewController</code> inside a <code>UITabBarController</code>. The master view is a TableView. When I click on a cell, I bring up a very basic view controller with just a <code>UIButton</code> centered. Here is the code for the view controller:</p>
  
  <pre><code>class TestViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
      @IBOutlet weak var button: UIButton!
  
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      @IBAction func buttonPressed(sender: AnyObject) {
          let pickerC = UIImagePickerController()
          pickerC.delegate = self
  
          pickerC.modalPresentationStyle = .Popover
          pickerC.popoverPresentationController?.sourceView = button as UIView
          pickerC.popoverPresentationController?.sourceRect = (button as UIView).bounds
          pickerC.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.Any
          self.presentViewController(pickerC, animated: true, completion: nil)//4
      }
  
      func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
          self.dismissViewControllerAnimated(true, completion: nil)
      }
  
      func imagePickerControllerDidCancel(picker: UIImagePickerController) {
         self.dismissViewControllerAnimated(true, completion: nil)
      }
  }
  </code></pre>
  
  <p>If I click cancel or select and image, the picker controller dismisses properly. The problem comes when I click on the back button to return to the TableView, I receive:</p>
  
  <pre><code>Unbalanced calls to begin/end appearance transitions for &lt;TestViewController: 0x7fb882a72380&gt;.
  </code></pre>
  
  <p>The <code>TestViewController</code> is very basic, so why would this be happening?</p>