@MainActor
struct Setting {
//свойство типа
static var mode: Int = 0
//метод типа
static func setNextMode() {
mode = (mode + 1) % 3;
}
}
Setting.mode = 3
Setting.setNextMode()
//Setting.mode is 1
print("mode is \(Setting.mode)")