Swift Retain Cycles and Strategies to Prevent Them

There are many articles written on this subject. Many of them suggest using Xcode’s memory graph debugger. Is there an easier way? I say yes! Unit tests to the rescue! The idea of the unit test is: Instantiate the object under test (“target”) and assign it to a nullable variable. Create a weak variable (“weakTarget”) and assign the target to it On the target, call a function to test for retain cycles Set target to nil Test weakTarget for nil, if it is not nil, there is a retain cycle For example, let’s say you have: To unit test for … Continue reading Swift Retain Cycles and Strategies to Prevent Them

NYC COVID-19, Wednesday

I’ve kind of given up on counting the days… This is going to take a while. They say the first NYC case of COVID-19 was around March 1st (a month ago). It was around March 10th when word came at the office that if we could work from home, to work from home. I was in the office on the 11th. I didn’t realize that would be the last time I’d be there for a good while. Fortunately, there wasn’t much I needed from there that I could find at home or order. We’ve been inside most of this time. … Continue reading NYC COVID-19, Wednesday

COVID-19, Work From Home Day 10

We had a bit of a scare at the beginning of the week. Turns out everyone is healthy and doing fine, if a bit cooped up. We’ve been making a point to briefly get outside and go around the block several times. Olessia took D out to the beach today. I’ve been working from home. Today the governor of New York stated non-essential businesses are to close and if they don’t, they’ll be fined. Self quarantine is recommended and to keep a distance of 6 feet from non-family members. Olessia has been great carrying for D. He’s getting all the … Continue reading COVID-19, Work From Home Day 10

COVID-19, Day 1 Work From Home

I’ve opted, for the safety of my family, to switch to working from home today. The trains and platforms were pretty full yesterday. It just adds unnecessary risk. I’m very fortunate the work I do can be done from just about anywhere. So today was spent getting work as well as settling in a more robust work space than the couch I’ve been using for one-off work from homes. So far D is still going to pre-k. He just started martial arts training this week and I got to watch him train today. As far as we know, he will … Continue reading COVID-19, Day 1 Work From Home