How can view controller present it's self?
<p>I have the following class below.  The idea is it will use a custom Progress Window View Controller to handle progress of various different events.  The problem is since this is in a class and not a view controller it's self, I'm not sure how to make the progressWindow actually show up after I instantiate it from the storyboard?</p>

<p>How do I do this? Currently I get an error that the application tried to present model view controller on itself.</p>

<pre><code>import Foundation
import UIKit

class StatusProgress{
    static var cancelCode = {}
    static var runCode = {}
    static var theProgressWindowController = ProgressWindowViewController()
    static var returningViewControllerIdentifier = ""
    static let storyboard = UIStoryboard(name: "Main", bundle: nil)

    static func run(){
        // This will run in parralel but on main queue.  Has to be on this Queue because it might involve UI
        dispatch_async(dispatch_get_main_queue(), {
            // Update the UI on the main thread.
            StatusProgress.runCode()
        });

    }

    static func cancel(){
        dispatch_async(dispatch_get_main_queue(), {
            StatusProgress.cancelCode()
            dispatch_sync(dispatch_get_main_queue(),{
                let storyboard = UIStoryboard(name: "Main", bundle: nil)
                let vc = storyboard.instantiateViewControllerWithIdentifier(returningViewControllerIdentifier)
                vc.presentViewController(vc, animated: true, completion: nil)
            })
        });
    }

    static func show(){
        dispatch_async(dispatch_get_main_queue(),{
            theProgressWindowController = self.storyboard.instantiateViewControllerWithIdentifier("progressWindow") as! ProgressWindowViewController
            theProgressWindowController.presentViewController(theProgressWindowController, animated: true, completion: nil) //use own instance to show it's self? (throws error! application tried to present modal view controller on itself. Presenting controller is &lt;Inventory_Counter.ProgressWindowViewController: 0x1466ea390&gt;.')
        })
    }
}
</code></pre>

<p>My <strong>problem</strong> is essentially I need a <strong>replacement for this line of code.</strong></p>

<pre><code>theProgressWindowController.presentViewController(theProgressWindowController, animated: true, completion: nil)
</code></pre>

<p>I forgot to mention here is the code that runs it inside another view controller.</p>

<p><strong>SyncViewController.swift</strong></p>

<pre><code>import UIKit

class SyncViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func yesSyncButtonAction(sender: UIButton) {
        StatusProgress.returningViewControllerIdentifier = "syncWindow"
        StatusProgress.runCode = {
            print("run code test")
        }
        StatusProgress.cancelCode = {
            print("cancel code test")
        }
        StatusProgress.show()
    }

    @IBAction func noSyncActionButton(sender: UIButton) {
        tabBarController?.selectedIndex = 1 //assume back to inventory section
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
</code></pre>