Create singleton of a viewcontroller in swift 3
<p>I know how to create singleton class in swift. The best and easy way to create singleton class is the following:</p>

<pre><code>class Singleton {
    static let sharedInstance = Singleton()
}
</code></pre>

<p>But I don't need singleton for any normal class. I need to create singleton for a viewcontroller class. So I'm using this code create singleton </p>

<pre><code>class AViewController:UIViewController {

    static let sharedInstance = AViewController()

    required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
}

}
</code></pre>

<p>it gives me error near <code>AViewController()</code></p>

<pre><code>Missing argument for parameter 'coder' in call
</code></pre>

<p>Looks like it want me to initialize with <code>init(coder: NSCoder)</code>. But what parameter or value should I pass through the <code>coder</code>?</p>