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

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ย. 2024

ความคิดเห็น • 30

  • @clarenceleong8289
    @clarenceleong8289 ปีที่แล้ว +3

    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?

    • @hannahwinner9935
      @hannahwinner9935 ปีที่แล้ว

      I am having the same issue..did you figure out how to fix it?

  • @mickdostie
    @mickdostie 2 ปีที่แล้ว +4

    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

    • @hannahwinner9935
      @hannahwinner9935 ปีที่แล้ว

      @@吳景漢 same problem for me too - were either of you able to fix it?

    • @kal1282
      @kal1282 ปีที่แล้ว +1

      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.

    • @kal1282
      @kal1282 ปีที่แล้ว

      Turns out it doesn't matter anyway with the introduction of EKWrapper 🤷🏻‍♂

    • @richardtopchii
      @richardtopchii  ปีที่แล้ว

      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.

  • @mrTumata
    @mrTumata 6 หลายเดือนก่อน

    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!

    • @richardtopchii
      @richardtopchii  6 หลายเดือนก่อน +3

      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.

  • @Lesig
    @Lesig ปีที่แล้ว

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

  • @suprimoklk8740
    @suprimoklk8740 2 ปีที่แล้ว +1

    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!

  • @VinceBelpiede
    @VinceBelpiede 2 ปีที่แล้ว

    Cool! What software do you use for screensharing?

  • @dmitrykniazik
    @dmitrykniazik ปีที่แล้ว

    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.

    • @richardtopchii
      @richardtopchii  ปีที่แล้ว

      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.

  • @2bornot2b69
    @2bornot2b69 ปีที่แล้ว +1

    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

    • @richardtopchii
      @richardtopchii  ปีที่แล้ว +1

      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+.

    • @2bornot2b69
      @2bornot2b69 ปีที่แล้ว +1

      @@richardtopchii legend! Thank you so much!!

    • @richardtopchii
      @richardtopchii  ปีที่แล้ว

      ​@@2bornot2b69Appreciate! Hope you've fixed your problem.

  • @bbkixx1
    @bbkixx1 ปีที่แล้ว

    Great tutorial !

  • @merp1639
    @merp1639 4 หลายเดือนก่อน

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

    • @richardtopchii
      @richardtopchii  4 หลายเดือนก่อน

      CalendarKit has changed API, so you need now to use DateInterval instead of setting startDate and endDate separately. Please check GitHub CalendarKit for reference.

  • @kh5322
    @kh5322 11 หลายเดือนก่อน

    how well maintained is calendarkit?

    • @richardtopchii
      @richardtopchii  11 หลายเดือนก่อน

      It's actively maintained and supports the latest Xcode and iOS versions.

  • @narenkrishnaa
    @narenkrishnaa ปีที่แล้ว

    Will it also support monthly calendar sheet?

    • @richardtopchii
      @richardtopchii  ปีที่แล้ว

      No, to have a month view, you'll need to use another library. CalendarKit supports Day view only.

    • @ankitumretiya636
      @ankitumretiya636 ปีที่แล้ว

      @@richardtopchii Can you please include the 3 Day view in it?

  • @unaivan
    @unaivan 11 หลายเดือนก่อน

    is support for macos?

    • @richardtopchii
      @richardtopchii  11 หลายเดือนก่อน

      Coming soon. For now only with Catalyst

  • @wowyummyyy
    @wowyummyyy 2 ปีที่แล้ว

    L I K E👍 👍👍 👍👍 👍👍 💯💯💯🤩 🤩🤩 🤩🤩🤩