I\'ve created a test application with timer before implementing it in my project. It was the first time I\'m using timer. But the issue is when I implemented timer using
Also one may want to make sure to add timer on the main thread.
assert(Thread.isMainThread) let timer = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(YourSelector), userInfo: nil, repeats: true)