Multi Thread access to shared Variables – Swift 4 Concurrency

Working with background threads really helps improve the app responsiveness & the overall user experience. But, and it’s a big but, you have to be aware of multithread access conflicts.  If you access/modify the same variable from multiple threads you’re prone to non-reproducible -seemingly random- crashes. How to Detect Conflicts? To help you find where …

Random numbers in Swift

Swift 4.2 has introduced a native random number API in the standard library, making it cross platform.  Int.random(in: 1…1000) // → 691 Double.random(in: 0..<1) // → 0.8741555749903935 UInt32.random(in: 0xD800…0xDFFF) // → 55666 Read more in the great article from Ole Begemann, worth a read.    Marc