We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4747102 commit 76973cdCopy full SHA for 76973cd
Examples/Example/Example3_TableViewEditing.swift
@@ -139,9 +139,11 @@ struct SectionedTableViewState {
139
}
140
141
extension TableViewEditingCommand {
142
+ static var nextNumber = 0
143
static func addRandomItem() -> TableViewEditingCommand {
144
let randSection = Int.random(in: 0...2)
- let number = Int.random(in: 0...10000)
145
+ let number = nextNumber
146
+ defer { nextNumber = nextNumber + 1 }
147
let item = IntItem(number: number, date: Date())
148
return TableViewEditingCommand.AppendItem(item: item, section: randSection)
149
0 commit comments