How to program a delay in Swift 3
<p>In earlier versions of Swift, one could create a delay with the following code:</p>

<pre><code>let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), 4 * Int64(NSEC_PER_SEC))
dispatch_after(time, dispatch_get_main_queue()) {
    //put your code which should be executed with a delay here
}
</code></pre>

<p>But now, in Swift 3, Xcode automatically changes 6 different things but then the following error appears: "Cannot convert <code>DispatchTime.now</code> to expected value <code>dispatch_time_t</code> aka <code>UInt64</code>."</p>

<p>How can one create a delay before running a sequence of code in Swift 3?</p>