We’ve been dealing with or avoiding the problem of network connectivity on iOS apps for years. Now you can monitor the network status with a callback sort of like you would with location or other services. And you can specify wi-fi or cellular.
I’m glad this finally made it to the to of Apple’s backlog! 👍
A beautifully elegant way to store Swift properties in UserDefaults or Keychain. This approach really makes the most of Swift extensions and protocol-oriented programming. And more than anything, it makes for very simple, reusable code.
As noted in this post , I’ve been swimming at a pool that is 33 ⅓ yards (100 feet) long instead of the usual 25 years. I had been tracking this length as 33 yards on my Apple Watch. But recently they added an actual “33 ⅓” length between 33 and 34. Even though that ⅓ of a yard doesn’t make a real difference to me in terms of health tracking, this still made my day because they were thinking of me and this weird pool. 👍
It shows what kind of impact attention to detail can have in a user interface. What can I say? I feel understood. 🤷🏻♂️
The Swift “defer” operator my not work exactly like you expect. It’s not exactly the last code executed before the function returns. Well, it kind of is. But also not so much. 🤦🏻♂️ As this article says, “defer” basically happens at the “ret” in “return”. 🤯
It takes a while to process what’s going on here, so take your time…
It’s also fascinating to see how what some very simple Swift code looks like when decompiled. Temporary registers. Global var access. Code injection in all the wrong places. 🤯 I have newfound respect for compiler writers.
And thanks to Sergey Smagleev on Medium for a great deep dive into “defer”.
Whoa, a simple three-liner has turned into this abomination that spans 34 lines of code.