Create iOS Calendar app in Swift with CalendarKit (Full Tutorial)

preview_player
Показать описание
Updated for the 8K resolution (7680 × 4320).
For the best experience, make sure to watch in the highest quality available.

This is a full CalendarKit tutorial where we'll build an app similar to the default iOS Calendar. It will display the events stored on the iPhone local calendar. Then we'll add event creation and editing support to our calendar application. We'll make it possible to edit the beginning and the end of the event by dragging it, as in the default iOS calendar app. To edit events by filling in a form we'll be using a framework called EventKitUI in addition to EventKit and CalendarKit.

Get the sample code for this app:

CalendarKit:

EventKit:
EventKitUI:

Subscribe and ring the bell to not miss next tutorials and iOS-related content. Have a suggestion? Leave it in the comments.

Watch two parts of this tutorial separately:
Part 1: Create iOS Calendar app in Swift with CalendarKit
Part 2: Editing events: iOS Calendar app in Swift with CalendarKit

Follow Richard on social media:

CalendarKit is a Swift calendar UI library for iOS, iPadOS and Mac Catalyst. It looks similar to the Apple Calendar app out-of-the-box, while allowing customization when needed. CalendarKit is composed of multiple modules which can be used together or independently.

Timecodes:
0:00 Intro
0:34 Create an Xcode project
1:34 Configure Xcode project
5:17 Testing our configuration
6:28 Installing CalendarKit
9:05 EventKit
10:22 Requesting calendar access
13:28 Adding events to the calendar
14:05 Displaying events in CalendarKit
15:04 Fetching events from the EventStore
18:30 Converting events to CalendarKit's format
22:23 Getting notified for event changes
25:29 1st milestone & explanation
26:22 Reacting to event selection
28:34 Adding a custom data model
36:35 Event detail view
41:15 How editing works in CalendarKit
47:28 Activating edit mode
51:28 Saving changes to the Event Store
54:50 Exiting edit mode
55:46 Creating new events
1:00:53 Showing a form for new events
1:07:34 Final result & explanation
1:08:11 Conclusion
Рекомендации по теме
Комментарии
Автор

Thanks for updating the video to 8K! Not many creators put the effort for just a small fraction of their viewers, now I can enjoy this video in my 1080p panel while fighting a war against Alphabets available bandwidth!

suprimoklk
Автор

There is some problems using the imported library in Xcode. I tried to set the title bar, the one that you taught in this video and trying out other methods but in iOS 16 it shows a black bar after the app loads. Please can you get back to me?

clarenceleong
Автор

Thank you for this great video. I'm considering using your library for my project app, but I do not want to use Apple's library under the hood (because I need to heavily customize events and associate custom data and such to them. Yet I do need to use features like recurrence). Would you have any recommendation for libraries or tools I could use? Or would you say I should just implement my own library for my purpose? Thank you again for this video!

mrTumata
Автор

Hey man, thanks for this tutorial. I have a slight issue at the 22:00 mark. After initializing the ckEvent variable which is an instance of the Event(), I try to set the ckEvent.startDate to ekEvent.startDate and I have an error. It says that the value of type 'Event' has no member 'startDate'. Thanks, any help is appreciated.

mickdostie
Автор

Thanks for this video. Do you know if it possible to get notified about Calendar changes when your app is in the background?

Lesig
Автор

Cool! What software do you use for screensharing?

VinceBelpiede
Автор

First of all, thanks for the library.
But why did you put these lines in the viewDidLoad() function:

dataSource = self
delegate = self

Do you understand this approach completely excludes following at least one of the SOLID principles?
It makes impossible to integrate it into SwiftUI without writing a code that smells.
I'll fork the library and make it work but I wanted you to know, so maybe you'll improve it sometime later.

dmitrykniazik
Автор

I keep running into the problem "Value of type 'Event' has no member 'startDate'" while making the eventsForDate function. How do I solve this?

merp
Автор

Thank you very much for this. Am a little stuck at the 'requesting calendar access' part. Swift is saying requestAccess method has been deprecated -> use @escaping which returns 2 errors. First one is @escaping attribute may only be used in function parameter position. The second: Cannot convert value of type '_.Type' to expected argument type (aka '(Bool, Optional<any Error>) ->()'). Any help is really appreciated

bornotb
Автор

Will it also support monthly calendar sheet?

narenkrishnaa