![]() I wish that my first experience with UICalendarView would have been excitement at trying it instead of frustration with trying to figure out how to use it. Even if it was a painfully basic example that would never make it into a production app it would still allow the reader to understand the foundation of how this feature works. With this documentation I have absolutely nothing to go on. I needed to write code for the “Your database implementation goes here.” How would I go about doing that? And wouldn’t the implementation for a UIKit app be different from a SwiftUI app? If there’s anyone even remotely connected to Apple documentation reading this I’m begging you to provide code examples in your documentation. Jordan Morgan also made an early blog post about UICalendarView and he showed how to populate emojis on every day.įunc calendarView( _ calendarView: UICalendarView, decorationFor dateComponents: DateComponents) -> UICalendarView.Decoration? It’s ironic that Majid posted that Tweet because the calendar View I had come up with before WWDC used some of his publicly available code (that I asked if I could use) as a starting point. 2erNUSUHnD- Majid Jabrayilov June 7, 2022 You can easily wrap the new UICalendarView with UIViewRepresentable and use in SwiftUI. Still, this Tweet from Majid made me want to jump into get this working in my SwiftUI app. Only for UIKit #Īs someone who has been focused on SwiftUI 100% for the last two years it’s the understatement of the decade to say that I’m rusty in UIKit. My excitement was tempered when I realized that this was an addition to UIKit and there was no SwiftUI equivalent (yet?). Apple makes accessibility a priority so you know that they’re going to handle that scenario for you. I was struggling with getting mine to look not-hideous with the largest accessibility fonts on the smallest screens. ![]() Using a built-in, Apple version of a calendar seems like a no-brainer in my situation. The version I had come up with would show an emoji instead of the day on populated days.Īs you can see in Pitt’s Tweet above the Apple implementation shows an emoji under the day (instead of covering the day), which I like better. I actually couldn’t believe my good luck because my calendar was so similar to what they were showing. I wonder how many custom calendars were made by the community due the lack of this feature (I created my own too)? □ #WWDC22 /Y6lWiuquzl- Pitt (Swift & Tips) June 10, 2022 Like my friend Pitt I had also created my own custom calendar implementation for my current side project.įor iOS 16, we got UICalendarView with great support for… you guess it: Calendars! □ I attended WWDC in person this year and I was so excited when I saw UICalendarView being demoed in the presentations. You can just jump to the code if that’s what you’re interested in. Here’s how I got a SwiftUI app to show the calendar based on custom dates and update the calendar when dates change. The new UICalendarView added to UIKit in iOS 16 looks great but there’s not a SwiftUI equivalent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |