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?
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.
It's been three months so hopefully you've figured this out by now, but for those that stumble upon this in the future: If you go into the Event() class's source code (cmd+click Event()), you can see that there is not startDate or endDate. It looks to have been replaced by a single variable representing a DateInterval(). Use the ekEvent's start and end dates to set a new DateInterval equal to your ckEvent in the map funciontion.
Glad you've found it out. Yes, with EKWrapper it doesn't matter. CalendarKit has changed the API a bit, to use a more modern syntax, that's why some of the code in this tutorial doesn't work. But check the GitHub sample app, it has been updated to accommodate the new syntax.
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!
You'll need to define your own data model and conform to the EventDescriptor protocol, then CalendarKit will be able to display your data. Just create your own class, similarly to the one used in the sample app. I'd recommend using CoreData for data modelling.
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!
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.
Hi, this approach is used very commonly in the Apple ecosystem, for example UICollectionViewController and UITableViewController both have their delegate and datasource properties set to self. If you're interested in bridging this library to SwiftUI, I suggest creating own version of a ViewController, similar to the DayViewController and bridging it instead. You'll be able to set the delegate and the datasource properties to whatever object you'd like. If you have a more detailed question, that hasn't been asked previously, feel free to create a new issue here: github.com/richardtop/CalendarKit/issues/new/choose and pick "question" from the menu. If you have a simpler question, feel free to ask it on stackoverflow.com/ with the CalendarKit tag. This approach does not violate any of the SOLID principles, as for your use-case you have to create your own custom UIViewController subclass and connect it to DayView directly, similarly to the DayViewController. This is also a correct approach and an acceptable use of the library. You can also use individual components to recompose your view in the SwiftUI domain, if you wish.
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 requestFullAccessToEvents(completion: @escaping EKEventStoreRequestAccessCompletionHandler) 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 'EKEventStoreRequestAccessCompletionHandler' (aka '(Bool, Optional) ->()'). Any help is really appreciated
Please take a look at this update: github.com/richardtop/CalendarApp/commit/a8b8eef69a26d555c449cc74682b862efc9608ac It's an iOS17+ change and you have to make it in order to run the app if you're using Xcode 15+.
CalendarKit has changed API, so you need now to use DateInterval instead of setting startDate and endDate separately. Please check GitHub CalendarKit for reference.
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?
I am having the same issue..did you figure out how to fix it?
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.
me too, same problem
@@吳景漢 same problem for me too - were either of you able to fix it?
It's been three months so hopefully you've figured this out by now, but for those that stumble upon this in the future:
If you go into the Event() class's source code (cmd+click Event()), you can see that there is not startDate or endDate. It looks to have been replaced by a single variable representing a DateInterval(). Use the ekEvent's start and end dates to set a new DateInterval equal to your ckEvent in the map funciontion.
Turns out it doesn't matter anyway with the introduction of EKWrapper 🤷🏻♂
Glad you've found it out. Yes, with EKWrapper it doesn't matter. CalendarKit has changed the API a bit, to use a more modern syntax, that's why some of the code in this tutorial doesn't work. But check the GitHub sample app, it has been updated to accommodate the new syntax.
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!
You'll need to define your own data model and conform to the EventDescriptor protocol, then CalendarKit will be able to display your data. Just create your own class, similarly to the one used in the sample app. I'd recommend using CoreData for data modelling.
Thanks for this video. Do you know if it possible to get notified about Calendar changes when your app is in the background?
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!
Cool! What software do you use for screensharing?
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.
Hi, this approach is used very commonly in the Apple ecosystem, for example UICollectionViewController and UITableViewController both have their delegate and datasource properties set to self. If you're interested in bridging this library to SwiftUI, I suggest creating own version of a ViewController, similar to the DayViewController and bridging it instead. You'll be able to set the delegate and the datasource properties to whatever object you'd like.
If you have a more detailed question, that hasn't been asked previously, feel free to create a new issue here: github.com/richardtop/CalendarKit/issues/new/choose and pick "question" from the menu.
If you have a simpler question, feel free to ask it on stackoverflow.com/ with the CalendarKit tag.
This approach does not violate any of the SOLID principles, as for your use-case you have to create your own custom UIViewController subclass and connect it to DayView directly, similarly to the DayViewController.
This is also a correct approach and an acceptable use of the library. You can also use individual components to recompose your view in the SwiftUI domain, if you wish.
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 requestFullAccessToEvents(completion: @escaping EKEventStoreRequestAccessCompletionHandler) 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 'EKEventStoreRequestAccessCompletionHandler' (aka '(Bool, Optional) ->()'). Any help is really appreciated
Please take a look at this update:
github.com/richardtop/CalendarApp/commit/a8b8eef69a26d555c449cc74682b862efc9608ac
It's an iOS17+ change and you have to make it in order to run the app if you're using Xcode 15+.
@@richardtopchii legend! Thank you so much!!
@@2bornot2b69Appreciate! Hope you've fixed your problem.
Great tutorial !
I keep running into the problem "Value of type 'Event' has no member 'startDate'" while making the eventsForDate function. How do I solve this?
CalendarKit has changed API, so you need now to use DateInterval instead of setting startDate and endDate separately. Please check GitHub CalendarKit for reference.
how well maintained is calendarkit?
It's actively maintained and supports the latest Xcode and iOS versions.
Will it also support monthly calendar sheet?
No, to have a month view, you'll need to use another library. CalendarKit supports Day view only.
@@richardtopchii Can you please include the 3 Day view in it?
is support for macos?
Coming soon. For now only with Catalyst
L I K E👍 👍👍 👍👍 👍👍 💯💯💯🤩 🤩🤩 🤩🤩🤩