-
-
Notifications
You must be signed in to change notification settings - Fork 2
Timer Initialising
Alina P edited this page Nov 30, 2024
·
10 revisions
Wszystko jest możliwe, trzeba tylko wiedzieć o sposobach
This page presents various options for incorporating MijickTimer
into your application. We begin by outlining the limitations of each method, helping you select the approach that best suits your requirements. While the code examples are based on iOS, they should also be compatible with macOS.
Note
MTimerID
structure is used to initialize and register MTimer
. It allows to get an access to a specific MTimer
from any place in the app.
MTimerID(rawValue: "Some Timer ID")
We advice to create a static properties to simplify the process of accessing the Timer ID
extension MTimerID {
static let id1 = MTimerID(rawValue: "Some Timer ID 1")
static let id2 = MTimerID(rawValue: "Some Timer ID 2")
static let id3 = MTimerID(rawValue: "Some Timer ID 3")
}
Initialising using String
value
let id = MTimerID(rawValue: "Some Timer ID")
let timer = MTimer(id)
Initialising using static MTimerID
value
let timer = MTimerID(.id1)