iosbrain / Swift-Timer-Demo

An Xcode 10 project, written in Swift 4.2, demonstrating my best practices for using the Timer class.

Home Page:http://iosbrain.com/blog/2018/10/31/using-the-swift-4-2-timer-class-in-xcode-10/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift Timer Demo

An Xcode 10 project, written in Swift 4.2, demonstrating my best practices for using the Timer class.

In the companion tutorial, I'll discuss how developers often need to do something many times and at regular intervals. One common application of such a use case is checking some process's or device's status, a process of called "polling." In the tutorial, I'll show you how to use the Swift 4.2 Timer class in Xcode 10 to repeatedly perform a simple task, every second, for 1 minute (60 seconds) -- and update the user interface (UI) on each "tick." You'll learn how to start a timer ticking, pause it, resume it, stop it, and do something on each tick.

Here's on of my apps using a Timer to perform animations -- and the UI remains responsive:

alt text


Copyright (c) 2018 Andrew L. Jaffee, microIT Infrastructure, LLC, and iosbrain.com.

About

An Xcode 10 project, written in Swift 4.2, demonstrating my best practices for using the Timer class.

http://iosbrain.com/blog/2018/10/31/using-the-swift-4-2-timer-class-in-xcode-10/

License:MIT License


Languages

Language:Swift 100.0%