LoginSignup
11
12

More than 5 years have passed since last update.

Swiftで一定時間後に処理を実行する

Posted at
let delay = 1 * Double(NSEC_PER_SEC)
let time  = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue(), {
  print("1秒後に実行される")
})
11
12
0

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
11
12