Michael Grant

Michael Grant

SwiftUI class notes 2021-12-05

Not following a tutorial today, just going to see if I can wrangle control of EventKit.

On weekends I’m trying to get away from tutorials per se, although at this point in my developer journey I’ll still be stealing adapting a lot of other people’s code. I’ll do my best to credit anyone whose code I cite here on the blog, and of course I’ll observe licenses when it comes to publishing anything.

I’m interested in working with EventKit, Apple’s framework for accessing calendar and reminders data. Specifically, I want to build an app that works with reminders. So far I haven’t found much any sample code online that uses EventKit in a SwiftUI environment; Apple’s Calendars and Reminders Programming Guide doesn’t even use Swift but rather Objective-C. (If he sees this @chrislowiec will be saying “I told you so!”)

I’m going to try starting with Peter Friese’s Building a To-Do List App with SwiftUI, Combine, and Firebase, which seeks to replicate the built-in iOS Reminders app, but instead of rolling a clone of the system’s underlying Reminders data store in Firebase I’ll be connecting to the original one. Once the basic create/delete/edit functionality is in place I have some ideas for different ways to view and manipulate tasks that I think could be useful for myself and others. Oh, and I’ll be writing mine for macOS and possibly iPadOS, because I think the iPhone screen is going to be too cramped for what I have in mind.

Since I’m going to be switching out bits and pieces derived from sample code from different sources, I’m making this as modular as I can, with a separate file for each view. Other than that, a #if statement for the .navigationBarTitle modifier that’s not available for macOS, and a few naming changes to make it easier to replace various elements of Friese’s code later, I haven’t yet written anything today that’s not taken directly from there, so there’s not much point in posting any of the code here.

Not sure if I’ll return to this before next weekend. Tomorrow I’m going to pick up where I left off in Paul Hudson’s 100 Days of SwiftUI.