I have a timer function (GCD) which is periodically consuming data from one end of an array. And the main thread wants to add data to the end of the array. Basically a queue. What's the idiomatic way to make sure everything is thread savvy/safe in Swift?
(Aside is it ok to ask Swift in the context of iOS questions here? Or is there a better place to ask those?)