LoginSignup
53
53

More than 5 years have passed since last update.

Swiftでdispatch_afterを使う

Posted at

Swiftではちょいちょい書式が変わったりするのでメモ。

let delay = 3.0 * Double(NSEC_PER_SEC)
let time  = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue(), {
    println("dispatch after!")
})
53
53
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
53
53