NSImage is dangerous

Screenshot of an excerpt from Xcode's debug console showing the output of AddressSanitizer, having detected data race involving NSImage.

NSImage is formally documented as largely not thread-safe: The following classes and functions are generally not thread-safe. In most cases, you can use these classes from any thread as long as you use them from only one thread at a time. Check the class documentation for additional details. Apple’s Threading Programming Guide > Appendix A:… Read more

Performing a delayed and/or repeating operation in a Swift Actor

Say you want to perform some operation after a delay, and/or at regular intervals, inside a Swift actor – maybe your actor represents a weather station and you want to periodically fetch the latest weather information, automatically. How do you do that? You could punt the problem to some other code, outside the actor –… Read more