NSTimer - how to delay in Swift

后端 未结 4 1014
轮回少年
轮回少年 2020-12-04 18:01

I have a problem with delaying computer\'s move in a game.

I\'ve found some solutions but they don\'t work in my case, e.g.

var delay = NSTimer.sched         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 18:48

    How about using Grand Central Dispatch?

    https://developer.apple.com/library/ios/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html

    Valfer has shown you how

提交回复
热议问题