You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, perhaps I'm missing something.
I've created a new project and installed via CocoaPods.
Repeat is not firing:
import UIKit
import Repeat
classViewController:UIViewController{overridefunc viewDidLoad(){
super.viewDidLoad()print("view did load")// Do any additional setup after loading the view, typically from a nib.Repeater.once(after:.seconds(5)){ timer inprint("tick")}lettimer=Repeater(interval:.seconds(5), mode:.infinite){ _ inprint("tock")}
timer.start()}overridefunc didReceiveMemoryWarning(){
super.didReceiveMemoryWarning()// Dispose of any resources that can be recreated.}}
Thanks
The text was updated successfully, but these errors were encountered:
Hi, you need to keep timer live around, ie by setting it as variable in your view controller (otherwise it will get deallocated automatically).
import UIKit
import Repeat
classViewController:UIViewController{privatevartimer:Repeater?overridefunc viewDidLoad(){
super.viewDidLoad()print("view did load")// Do any additional setup after loading the view, typically from a nib.self.timer =Repeater.once(after:.seconds(5)){ timer inprint("tick")}lettimer=Repeater(interval:.seconds(5), mode:.infinite){ _ inprint("tock")}
timer.start()}overridefunc didReceiveMemoryWarning(){
super.didReceiveMemoryWarning()// Dispose of any resources that can be recreated.}}
Hello, perhaps I'm missing something.
I've created a new project and installed via CocoaPods.
Repeat is not firing:
Thanks
The text was updated successfully, but these errors were encountered: