I saw atomic counters api for mac/osx, but I didn’t understand.Do you explain me ? How I can do increment column starting 10.000 increment by 1 in swift ?
Hi!
Every new counter has initial value = 0.
You can check in your code if initial value == 0 and automatically increment it on 10000.
func counters() {
Types.tryblock({ () -> Void in
let myCounter = "test";
if self.backendless.counters.get(myCounter) == 0 {
let initValue = self.backendless.counters.addAndGet(myCounter, value: 10000)
print(initValue)
} else {
let cont = self.backendless.counters.addAndGet(myCounter, value: 1)
print(cont)
}
},
catchblock: { (exception) -> Void in
print("\(exception as! Fault)")
}
)
}
Regards,
Kate.
Thank you Kate.