Search results for

calendar

1,863 results found

Post

Replies

Boosts

Views

Activity

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
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
Can't download 15.4 beta 1
Hi. I have three disk partitions on my MacBook Air M1. The one with Monterey, the one with Sonoma, and the one with Sequoia (15.3.1 in particular). When I try to download the 15.4 Beta from software update in settings, everything would go fine - the download process is being completed, the computer says it's going to restart in 60seconds, the countdown begins, etc. However, when restarting several times, I am being logged in once again into previous macOS (15.3.1) version, with a kernel panic report. I had the same panic on macOS 15.3 when attempting to download 15.4 Beta. I've upgraded my macOS to 15.3.1, as I thought I'd need the very last available version of regular macOS to participate in the newest beta. However, the panic occurs, pointing to some t8020dart.c file. I don't even theoretically know what is this and couldn't find any reference to that C file. Attaching a part of panic report: panic(cpu 3 caller 0x0): t8020dart 0xfffffdf02c980000 (dart-disp0): Can't ignore lock validation @t8020dart.c:535 D
4
0
758
Feb ’25
Swift Charts: How to prevent scroll position jump when loading more data dynamically
I'm implementing infinite scrolling with Swift Charts where additional historical data loads when scrolling near the beginning of the dataset. However, when new data is loaded, the chart's scroll position jumps unexpectedly. Current behavior: Initially loads 10 data points, displaying the latest 5 When scrolling backwards with only 3 points remaining off-screen, triggers loading of 10 more historical points After loading, the scroll position jumps to the 3rd position of the new dataset instead of maintaining the current view Expected behavior: Scroll position should remain stable when new data is loaded User's current view should not change during data loading Here's my implementation logic using some mock data: import SwiftUI import Charts struct DataPoint: Identifiable { let id = UUID() let date: Date let value: Double } class ChartViewModel: ObservableObject { @Published var dataPoints: [DataPoint] = [] private var isLoading = false init() { loadMoreData() } func loadMoreData() { guard !isLoading else { re
6
0
539
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
UICalendarView with decorations - change day height
Is there any way to change the height of the day cells in the UICalendarView? The view is very tall on the screen and I'd like to shorten it so I can put more content below it without using a scroll view. I'm using SwiftUI with a UICalendarView with UIViewRepresentable. The calendar will have default decorations to indicate a date with events.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
209
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
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
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