calling a method after each 60 seconds in iPhone

后端 未结 6 1807
我在风中等你
我在风中等你 2020-12-08 07:04

I have created an GKSession and as its object is created, it starts search for availability of devices, as

 - (void)session:(GKSession *)session peer:(NSStri         


        
6条回答
  •  清歌不尽
    2020-12-08 07:52

    Swift 5.0

    var timer = Timer.scheduledTimer(timeInterval: 60.0, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)
    
    @objc func updateTimer() {
       print("1 min passed")
    }
    

提交回复
热议问题