Skip to content

Instantly share code, notes, and snippets.

View tkaravou's full-sized avatar

Terry Karavoulias tkaravou

View GitHub Profile
tkaravou / SwiftCalendarView.swift
Last active September 29, 2022 13:06
How to add an event to a Calendar using Swift/SwiftUI
// You will need to add `Privacy - Calendars Usage Description` as a key in your plist file.
// If you don't have a plist file, click on your project's name > Info and add the key there
// The value should be a brief description as to why you need access to the calendar
// This gist will create the event as soon as the view is loaded
// You'll want to attach it to a button or an action instead
// Place the following code in one of your SwiftUI View files
let store = EKEventStore()