WWDC – Day 5

I wanted to start this day early, since I was declined for my second Lab request. I have been working on Shortcuts support in Wasted Time and while I had a great session on Wednesday, I am still having issues with the launching of Wasted Time from the Shortcuts app. I am getting a “Sorry there was a problem with the app” error. So I started the day early and went back to a WWDC19 session on Adding Parameters for Shortcuts. While it was helpful, it didn’t solve my problem and I will have to go back to a WWDC18 sessions on Shortcuts.

My second session was one that should have directly helped me – it was called Decipher and Deal with Common Siri Errors. This two minute session gave a few tips for debugging Siri errors, and by inference Shortcut errors. The first tip is that in Xcode you can pass a Siri command to the run command. That doesn’t really help me, but there was still hope. The second thing is you can look at the Console log and monitor the simulator for error messages. This should be helpful and I will do this, to see if I can figure out which of the three common problems above are the problem. The third suggestion was about using os_log statements to capture the program flow. While I do this with print statements, it seems that this may be better. I already had plans to change my prints to os_log statements based on a session earlier in the week.

The next session (number three for those keeping count) was called “Empower Your Intents”. This was a deeper dive into the technology behind intents. The one piece that was helpful to my problem was about adding in-app intent handling. This perhaps would be helpful in dealing with my issue, as I could at least allow Siri control for adding and removing people to a meeting with out major problem. Much of the processing I want to add is more appropriate for running in the app anyway. But to handle in-app intent handling I would need to change the architecture of my app to be a multi-window app. Not sure that is really appropriate for it’s function. Will have to think thru this.

The next session was about handling background mode for your app. This seemed like it might help me, but turned into a session about optimization of your app. Not a bad session at all, and it explained how iOS manages background execution and prioritization. What was most interesting was how your user’s behavior will change your background processing over time. Additionally, did you know that all apps are set to run in the background by default. I will have to do a better job of going thru my settings on my machine and turn that off more apps. There are 7 factors that iOS uses to manage background execution priorities, and many of them are under the user’s control.

Next (Session 5) was on designing great widgets. While this was interesting, I didn’t focus on it much, as they spent tons of time explaining the design aesthetics of their own apps. I really should spend more time in the design documentation that Apple provides. Perhaps that would make my app gain more users, perhaps not.

Session 6 – Structure Your App for SwiftUI Previews! Ok, now this session was amazing. I have been enjoying SwiftUI over the last year, but as it was the first release, Xcode has been a bit buggy. This session really showed what it could be, once you restructure how you code in Xcode and with SwiftUI. I’ve under used Pinning of views, this is when you lock a specific Preview so that as you move to other source modules you can see how your changes impact it in real time. Adding multiple Preview Groups is something I have used, especially in building my new Widget for Wasted Time. The other key thing I need look at for my app, from this session, was the use of the @StateObject – this will allow key models in your to only be created when you first launch your app. The other key insight that came thru is to break up your screens into multiple smaller views. You won’t get penalized by this approach, and it allows for you to do interesting things with the new found modularity of your app.

Session 7 was about Building SwiftUI views for Widgets. The speaker did a great job of showing many trick and tips to build out a caffeine tracking app and widget. I will need to download the code for future reference. To better adapt Apple’s design principles they have added a new CornerRelativeShape feature, that will make your views conform with the high-level view they sit in. If you look above you can see it in the Caffeine widget. The other key new feature is relative date/time processing. As you can see in the code above, if you use these in a widget, it will dynamically update to show relative time. In this case, the last time you had coffee. If I were to add tracking of when your last meeting was in Wasted Time, I could show a time tracker. Should I do this?

Session 8 – we are getting down to the wire (my plan was 9 sessions a day for a total of 36 session. SF Symbols 2 – Symbols were introduced last year for iOS and WatchOS, they are now available for macOS Big Sur. These symbols are powerful in how they behave across platforms and sizes. They now have over 750 symbols to help change the iconography of your app. They also have added multi-color capabilities. I have updated WastedTime last year to use this iconography, but will need to double check how I am doing it, as there are some things that would make it much better looking this year. I’ve wondered if any of my users have even noticed yet. Oh, and by the way, they renamed some of them, so developers do need to deal with deprecated names in their code, if they support back levels of the OS. I also never thought about localization of iconography, but good thing Apple has. Icons can be flipped for right to left languages, and in some case they have different glyphs in side to reflect the differences in how script looks.

And what was my last session? Well Core Data of course! (Seriously, I am still not 100% comfortable with Core Data, and was really looking forward to a total reimagine of this with some like SwiftData (maybe one day)). This session really went deep into how to handle batch processing. As more and more data is being stored online, the core data team has been modernizing these processes and making it much more performant for cloud access. I applaud the team doing this. Perhaps one day I can take advantage of it.

After a few more days I will give a summary of what I thought overall about an online only WWDC.