The expected number of months for the below code should be -48 months. It used to work like this Until iOS17. Now when building with iOS 18 it gives -47 months. Changing the two dates with one day back works as expected import Foundation var calendar = Calendar(identifier: .gregorian) calendar.timeZone = .gmt let components1 = DateComponents( calendar: calendar, year: 2004, month: 2, day: 29 //28 in case of changing day to 28 it works as expected ) guard let date1 = components1.date else { exit(1) } let components2 = DateComponents( calendar: calendar, year: 2008, month: 2, day: 29 //28 in case of changing day to 28 it works as expected ) guard let date2 = components2.date else { exit(1) } print(date1) print(date2) let months = calendar.dateComponents([.month, .isLeapMonth], from: date2, to: date1) print(months)
Search results for
calendar
1,863 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am seeing a strange warning pop up in my SwiftData ModelActor: Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates. This warning is triggered by the try self.modelContext.save() call in the following function in my ModelActor: public func purgeLocalEvents(for calendarId: PersistentIdentifier) async { do { let calendars = try self.modelContext.fetch(CalendarFetchDescriptors.getCalendar(calendarId)) if let calendar = calendars.first { if let events = calendar.events { for event in events { self.modelContext.delete(event) } } calendar.lastSync = .distantPast try self.modelContext.save() } } catch { debugPrint(Error loading calendar for event purge, error.localizedDescription) } } The function in the ModelActor is called like this: Task.detached(priority: .userInitiated) { let actor = await RemoteGoogleCalendarActor(modelContainer: SwiftDataCoordinator.shared.fullContainer) await
Hello @Moshegon, thank you for your post. For help with the Calendar app, please post in the Apple Support Community. The Apple Developer Forums are for questions about APIs and features intended specifically for developers.
Hi, starting from iOS18, it is impossible to differentiate between completed meetings and future meetings in calendar - almost the same color (unless I switch to dark mode). Is there a way to fix it or is it a human engineering bug?
I created a local notification as follows: func scheduleNotification(title: String, subtitle: String = , date: Date, id: String) { // Extract the components from the date let calendar = Calendar.current let hour = calendar.component(.hour, from: date) let minute = calendar.component(.minute, from: date) let second = calendar.component(.second, from: date) // Set the extracted components into DateComponents var dateComponents = DateComponents() dateComponents.hour = hour dateComponents.minute = minute dateComponents.second = second let content = UNMutableNotificationContent() content.title = title content.subtitle = subtitle content.sound = UNNotificationSound.default let action1 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.label, options: []) let action2 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.label, options: []) let categor
Drop in sessions which uses EKEventEditViewController works fine. Because the event edit view controller renders its content out of process, it has full access to all the user’s calendars on the device, regardless of the access granted to the app.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Problem Description: In a SwiftUI application, I've wrapped UIKit's UIPageViewController using UIViewControllerRepresentable, naming the wrapped class PagedInfiniteScrollView. This component causes navigation bar elements (title and buttons) to disappear. This issue only occurs in Low Power Mode on a physical device. Steps to Reproduce: Enable Low Power Mode on a physical device and open the app's home page. From the home page, open a detail sheet containing PagedInfiniteScrollView. This detail page include a navigation title and a toolbar button in the top-right corner. PagedInfiniteScrollView supports horizontal swiping to switch pages. Tap the toolbar button in the top-right corner of the detail page to open an edit sheet. Without making any changes, close the edit sheet and return to the detail page. On the detail page, swipe left and right on the PagedInfiniteScrollView. Expected Result: When swiping the PagedInfiniteScrollView, the navigation title and top-right toolbar button of the detail page should
I just lost my calendar and I need this .
Topic:
Community
SubTopic:
Apple Developers
I love the new feature of being able to see reminders in my calendar but the reminders have been duplicated and I am unable to edit or delete the duplicates. Also, in the health app settings > data access and devices: the this of devices I can link to the health app lists each device many times. For example: “apple watch” is listed more than ten times. “iphone” is listed at least 20 times. Etc.
I have the full version of IOS 18 installed on iPhone 15 pro. A deleted recurring reminder is showing on my iPhone Calendar but not on my MacBook calendar or my iPad calendar. When I go into the delete from Calendar the opened tab is blank!
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
I have a feature where I need to write some events to the calendar. It's not working saying Calendar is read only. So I tried the sample app from Apple - Repeating lessions and drop in lessions from link below https://developer.apple.com/documentation/eventkit/accessing_calendar_using_eventkit_and_eventkitui Drop in sessions which uses EKEventEditViewController works fine. But when I run Repeating lessions which requires calendar permissions it keeps saying Calendar is read only. I have hit allow on the access permissions alert and also check settings which shows app has required permissions. can someone help why this is the case? if its a Calendar issue where do you set the modifiable permissions for it? How is EKEventEditViewController able to save events if the Calendar is readonly.
For help with calendar events, please post in the Apple Support Community. The Apple Developer Forums are for questions about APIs and features intended specifically for developers.
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
in ios17 you could cut a spam event and it would remove the series...in ios18 when you cut the series it removes but pop right back
They took away the ability to see the location field under the calendar event unless it is an actual location. This sucks! I use my calendar to house all my bills to make sure I pay everything every month. I used to type the word “paid” in the location field and then it was easy to go through my calendar and see what was paid and what wasn’t. Now I have to click on each individual event instead of just the day to see the notes for it. What a pain…. Apple Devs, fix this please. Bring back that location/notes field under the event description from whole month view.
Topic:
Community
SubTopic:
Apple Developers
I have been looking online to see whether anyone else is having this problem. I have installed IOS 18 beta on all three of my iOS devices (iPhone and 2 iPads). ONLY ON MY PHONE the calendar is showing duplicate copies of a reminder (randomly with no apparent pattern) . When I select the option to go to the reminder in the reminders app, it goes to the reminders app and shows me only the single reminder. Here's where it gets weird. I delete the reminder from the reminders app and it still shows multiple copies of that reminder which should no longer exist. Any insight is appreciated. BTW. I downgraded my iPhone back to IOS 17. I submitted this on the feedback app already.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program