WWDC 2021: Day 2 Thoughts

I watched a few sessions, mostly the overview ones.

watchOS

I’m even more excited by the always-on screen for apps. Workout apps, like Sprint-o-Mat, will be able to update the screen every second while running a workout session. This is good enough for me. They also let you know (via a SwiftUI modifier) that the screen is in the dimmed state, so you can reduce detail and focus on the most important parts of your interface.

There is also a Canvas in SwiftUI for watchOS now. Right now, the main view for Sprint-o-Mat uses stretched Circles to draw the progress rings. I did this because SwiftUI does not support elliptical arcs. I will have to check to see if Canvas is more powerful.

I also missed that unit tests work for watchOS targets in the latest Xcode. I currently keep testable code in a swift package so I can test it.

Swift

I hope that the improved type inference speed really works. I run into problems with this for even fairly simple code (where Swift just gives up and you need to rewrite it to be more explicit).

I also was unaware of Swift Numerics, which is nice. What I really want is something like a DataFrame, like Pandas, but this is a foundational step. I still use python as my “go to” for when I need something one step past a spreadsheet, even if I don’t need these features because I know they will be there if I need them.

One small thing that makes my life easier is that CGFloat and Double will automatically convert without an explicit cast. I write a lot of SpriteKit tutorials on App-o-Mat, and I like to keep the code super-simple.

And of course, async/await, will make lots of code better. I use it all of the time in Typescript, and I am looking forward to adopting it. Sprint-o-Mat is extremely asynchronous and I mostly solve its complexity with Combine today.

Speaking of Combine, I was somewhat surprised to see no mention at all so far, so I don’t think we’ll see more adoption in the frameworks this year.