dispatch_after - GCD in Swift?

前端 未结 25 2394
心在旅途
心在旅途 2020-11-21 06:07

I\'ve gone through the iBook from Apple, and couldn\'t find any definition of it:

Can someone explain the structure of dispatch_after?

d         


        
相关标签:
25条回答
  • 2020-11-21 06:51

    Swift 4 has a pretty short way of doing this:

    Timer.scheduledTimer(withTimeInterval: 2, repeats: false) { (timer) in
        // Your stuff here
        print("hello")
    }
    
    0 讨论(0)
提交回复
热议问题