Search results for

calendar

1,863 results found

Post

Replies

Boosts

Views

Activity

Device Activity - DeviceActivitySchedule DateComponents intervals
Hi, I'm having trouble understanding what is the correct DateComponents format for the DeviceActivityCenter.startMonitoring to work as expected. Here's how it behaves with my setup: The schedule interval is set for 15 minutes (the minimum). On intervalDidStart I set the shields shield.applicationCategories = .all(except: exclCat) shield.webDomainCategories = .all(except: exclWeb) On intervalDidEnd I clear the settings shield.applicationCategories = nil shield.webDomainCategories = nil Different behavior with different DeviceActivitySchedule intervals. In the below examples I'll refer to hour, minute and second components as time components, and the calendar, timeZone, year, month, day, hour, minute and second components as date and time components. Also, with all combinations below no errors are thrown when calling the startMonitoring method. A. ❌ The start interval has time components, while the end interval has date and time components: The intervalDidStart is not triggered. DeviceActivitySchedule(
6
0
2.2k
Oct ’23
Reply to Apple Calendar not working with RDATE in RFC 5545
Thanks for your reply, I think this should be a bug report. I'm currently working on a multi-platform calendar and planner sharing tool. As the calendar software on every Apple device does, people can sync their calendars using iCloud and use that to share their calendars with others in the form of public links. RFC 5545, also known as iCalendar, is the standard for exchanging information for these functions. Typically, a simple event implementation would look like this (according to 3.6.1. Event Component) BEGIN:VEVENT UID:some unique numbers SUMMARY:things to be happened DTSTART;TZID=Asia/Singapore:20240301T100000 DTEND;TZID=Asia/Singapore:20240301T120000 END:VEVENT The above describes a two-hour schedule. However, not everything is a one-time event, and sometimes the event may need to be repeated at regular intervals, so it is possible to repeat it at regular intervals according to the rules of 3.8.5.3 Recurrence Rule, and there are also EXRULE tags for excluding a date
Mar ’25
Reply to Apple Calendar not working with RDATE in RFC 5545
I'm not sure if this is a bug report or an enhancement request. Either way, I think it would be good for our engineering teams to investigate. Can you provide more details about what you're trying to do and what APIs you are using? Please file a bug report/enhancement request asking for RFC 5545 date format support. You can file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why? If you are simply using the Calendar and not writing software, then won't you please consider posting this question in the Apple Support Community discussion forums. The Apple Developer Forums are for questions about APIs and features intended specifically for developers.
Mar ’25
How often iCloud will sync with local swiftData?
Hi, I have developed a calendar app with swiftData. I have set it to sync iCloud. When testing it, it seems that everything is fine. But after it's released, today, I uninstalled it and reinstalled it again. And I found that iCloud hasn't sync with local swiftData for six days. I have lost six days agenda and relevant information. I have checked the document, and it's said that there is no method to force to sync with iCloud. How to solve the issue? I think that the users can't forgive that it hasn't synced for six days. Best Wishes,
3
0
372
Mar ’25
Finance Report API - no data
I'm querying the Finance Report api to get a January report for my app, yet no data is present. It's now March 3rd, and executing the following query results in a 404. url_financial = ( https://api.appstoreconnect.apple.com/v1/financeReports ?filter[regionCode]=ZZ &filter[reportDate]=2025-05 &filter[reportType]=FINANCE_DETAIL &filter[vendorNumber]=redacted ) If I change the report date to 2024-04, I get December, yet January is still unavailable. I understand that Apple's fiscal calendar does not follow the Gregorian calendar, however I'd expect that in March I could query the next period after December. Is this normal?
1
0
349
Mar ’25
Reply to iOS 18 Bug -Certificate Trust Settings for Private Root Certificates Not Available
iPhone 15 Pro. Using IOS 18.3.1 from upgrade, but still having this issue against Baikal CalDav server, which worked fine until this upgrade. I had a certificate expire on the server and installed the new one (Godaddy). I only have this issue for caldav, it works fine for other TLS/SSL connections (SMTP, IMAP, HTTPS, etc). I do not get this error if I make the same connection in Safari on the iphone to the SAME URL I'm making with the default IOS calendar app.
Feb ’25
Reply to Automatic Background File Uploads
Thank you for this! I have a very similar use case where we need to upload heath data nightly. I just changed our implementation to use BGProcessingTaskRequest, however it still didn't seem to work. We use SwiftUI. Please note that the following code is written for testing, so it is scheduled to be 1 minute out. And since I am running this often, I have the App Delegate cancel previous tasks before registering/scheduling a new one. In real life, we will have it scheduled for 3 AM daily, and the app delegate will check if a task is already scheduled and, if not, schedule it. Also note that we have user consent and permissions enabled and this process is handled elsewhere. In our AppDelegate class, we have: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { self.healthKitStuff() return true } func healthKitStuff() { BGTaskScheduler.shared.getPendingTaskRequests { result in let alreadyScheduled = result.contains
Feb ’25
multidatepicker and saving multiple dates via swiftdata
Any help will be greatly appreciated. Trying to build a calendar/planner app for public school teachers. Classes are held on multiple dates so there is a need for swiftdata to save multiple dates. There are lots of tutorials demonstrating a multidatepicker but none of the tutorials or videos save the dates, via swiftdata. My goal is to save multiple dates. Step 1 is to initialize mockdata; this is done a class called ToDo. var dates:Set = [] Step 2 is the view containing a multidatepicker and other essential code Step 3 is to save multiple dates using swiftdata. Lots of tutorials, code snippets and help using a single date. But after almost 2 weeks of researching youtube tutorials, and google searches, I have not found an answer on how to save multiple dates via swiftdata. Also, I don't know how how to initialize the array of for the mockdata. Here are some code snippets used but the initialization of the array of DateComponenets doesnt work. And saving multiple dates doesn't work either @MainActor @
2
0
656
Feb ’25
Dateformatter returns date in incorrect format
I have configured DateFormatter in the following way: let df = DateFormatter() df.dateFormat = yyyy-MM-dd'T'HH:mm:ss'Z' df.locale = .init(identifier: en) df.timeZone = .init(secondsFromGMT: 0) in some user devices instead of ISO8601 style it returns date like 09/25/2024 12:00:34 Tried to change date format from settings, changed calendar and I think that checked everything that can cause the problem, but nothing helped to reproduce this issue, but actually this issue exists and consumers complain about not working date picker. Is there any information what can cause such problem? May be there is some bug in iOS itself?
1
0
441
Feb ’25
Reply to Date that is not linked to TimeZone
By “Date objects” you meant the Foundation Date structure, right? If so, that type doesn’t include a time zone. It’s underlying storage is a Double, being the time offset in seconds from the reference date, that is, the start of 2001 in GMT. In the Foundation design, time zones are considered to be a rendering issue. That is: When you use Calendar to convert a Date to DateComponents, the timeZone property affects the values you get back. Likewise when you go the other way. And likewise when you use a DateFormatter, which uses date components operation internally. Or a UI component, like NSDatePicker. So if your dates shown by your app are changing, it’s nothing to do with the Date values but with how you’re rendering them. How are you doing that? Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: App & System Services SubTopic: General Tags:
Feb ’25
Signal SIGABRT on accessing values from SwiftData query
I work on an iOS app using SwiftUI and SwiftData. I added a computed property to one of my models - Parent - that uses relationship - array of Child models - data and I started getting strange problems. Let me start with models: @Model final class Parent { var name: String @Relationship(deleteRule: .cascade, inverse: Child.parent) var children: [Child]? = [] var streak: Int { // Yes, I know that's not optimal solution for such counter ;) guard let children = children?.sorted(using: SortDescriptor(.date, order: .reverse)) else { return 0 } var date = Date.now let calendar = Calendar.current for (index, child) in children.enumerated() { if !calendar.isDate(child.date, inSameDayAs: date) { return index } date = calendar.date(byAdding: .day, value: -1, to: date) ?? .now } return children.count } init(name: String) { self.name = name } } @Model final class Child { var date: Date @Relationship(deleteRule: .nullify) var parent: Parent? init(date: Date, parent: Parent) { self.date = date self.parent = parent
3
0
744
Feb ’25
DeviceActivityMonitor.intervalDidEnd never getting called
I'm trying to build an app with a DeviceActivityMonitor extension that executes some code after 15 minutes. I can confirm that the extension is set up correctly and that intervalDidStart is executed, but for some reason the intervalDidEnd method never gets called. What I'm doing in both is just registering a local notification. class DeviceActivityMonitorExtension: DeviceActivityMonitor { let store = ManagedSettingsStore() override func intervalDidStart(for activity: DeviceActivityName) { createPushNotification( title: Session activated!, body: ) super.intervalDidStart(for: activity) } override func intervalDidEnd(for activity: DeviceActivityName) { createPushNotification( title: Session ended, body: ) super.intervalDidEnd(for: activity) } private func createPushNotification(title: String, body: String) { let content = UNMutableNotificationContent() content.title = title content.body = body // Configure the recurring date. var dateComponents = Calendar.current.dateComponents([.era, .year, .month, .day, .hou
1
0
383
Feb ’25
Getting Error: Type '()' cannot conform to 'View'
can't see what the problem is .. Im getting the error: Type '()' cannot conform to 'View' struct CalendarView: View { @StateObject private var viewModel = CalendarViewModel() @State private var selectedDate: CalendarDate? @State private var showModal = false var body: some View { VStack { Text(Calendar App) .font(.largeTitle) .padding() GridStack(rows: 5, columns: 7) { row, col in let index = row * 7 + col if index < viewModel.calendarDates.count { let calendarDate = viewModel.calendarDates[index] Text((Calendar.current.component(.day, from: calendarDate.date))) .frame(width: 40, height: 40) .background(calendarDate.isSelected ? Color.blue : Color.clear) .cornerRadius(10) .foregroundColor(calendarDate.isSelected ? Color.white : Color.black) .onLongPressGesture { selectedDate = calendarDate showModal = true } } } } .background(Color.gray) .sheet(isPresented: $showModal) { if let date = selectedDate { DateSelectionModal(selectedDate: date) } } } } struct GridStack: View { let rows: Int let columns:
Topic: UI Frameworks SubTopic: SwiftUI
2
0
194
Feb ’25
Reply to Date constant from year, month, day
Claude31, Thanks for the reply. It works. I figured it had something to do with calendars and timezones, but I couldn't find a simple example of how to put it all together. I'll keep your function handy. I live in the US Eastern Time Zone, so when I put in a date in GMT, it ended up the previous day, which makes sense. I changed the timezone to EST and then the date was correct. I'm used to Python which has both naive and aware (of time zone) date time values. Apparently, Swift's Date object is aware. Does Swift have a naive date time concept?
Topic: App & System Services SubTopic: General Tags:
Feb ’25
Reply to Date constant from year, month, day
Did you try this: func makeDate(year: Int, month: Int, day: Int, hr: Int = 0, min: Int = 0, sec: Int = 0) -> Date { var calendar = Calendar(identifier: .gregorian) calendar.timeZone = TimeZone(identifier: GMT)! let components = DateComponents(year: year, month: month, day: day) //, hour: hr, minute: min, second: sec) return calendar.date(from: components)! } let myDate = makeDate(year: 2025, month: 02, day: 10) print(myDate)
Topic: App & System Services SubTopic: General Tags:
Feb ’25