Search results for

calendar

1,863 results found

Post

Replies

Boosts

Views

Activity

An issue with DateComponents
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)
1
0
421
Nov ’24
modelContext.save triggers warning: publishing changes from background threads is not allowed
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
2
0
1.1k
Oct ’24
Device Activity Monitor Extension behaves randomly - any idea?
Hello, I'm working on an app that makes use of Screen Time features by leveraging the Family Controls, Device Activity and Managed Settings frameworks. The main app works fine by shielding/unshielding apps with a toggle. When it comes to monitoring the time intervals with the Device Activity Monitor (DAM) extension (e.g. lock X apps for Y minutes), I'm experiencing several issues. To shield/unshield apps and kick off the monitoring I perform the following instructions: let timeInMinutes = 15 let startDate = Date(timeIntervalSinceNow: 1.0) // padding added to avoid invalid DAM ranges < 15 mins. let endDate = startDate.addingTimeInterval(timeInMinutes * 60.0) let components: Set = [.day, .month, .year, .hour, .minute, .second] let calendar = Calendar.current let intervalStart = calendar.dateComponents(components, from: startDate) let intervalEnd = calendar.dateComponents(components, from: endDate) let schedule = DeviceActivitySchedule(intervalStart: intervalStart, intervalEnd: intervalEnd, repeats:
5
0
3.3k
Sep ’24
Reply to Meetings color in calendar
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.
Topic: Design SubTopic: General Tags:
Oct ’24
Meetings color in calendar
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?
Topic: Design SubTopic: General Tags:
2
0
510
Oct ’24
Reply to EKEventStore unable to save events
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:
Oct ’24
EKEventStore unable to save events
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.
1
0
504
Oct ’24
IOS18 Problems with duplications
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.
1
0
343
Sep ’24
iOS calendar features
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.
1
0
257
Sep ’24
ControlConfigurationIntent won't open the app despite setting openAppWhenRun = true
I am working on building Control widgets for our app and have noticed that openAppWhenRun doesn't seem to work for any ControlConfigurationIntent. When attaching the debugger to the widget extension in a sample project, I see the following error: Unknown NSError The operation couldn’t be completed. (LNActionExecutorErrorDomain error 2018.) This is reproducible as of Xcode 16.0 Beta 2 and Beta 3. I have noted that using an OpenIntent, with a parameter called target that conforms to AppEnum seems to open the app properly, but if I use that workaround, adding any additional parameters to the OpenIntent seems to break things again. Are others seeing this issue? I have feedback FB14357691. Here's some sample code below to reproduce: var body: some ControlWidgetConfiguration { AppIntentControlConfiguration(kind: Open Any Screen, intent: OpenAppScreenIntent.self) { template in ControlWidgetButton(action: template) { Label { Text(Open App) } icon: { Image(systemName: calendar) } }.tint(.red) } } } enum AppSc
6
0
2.0k
Sep ’24