I've been trying to figure out what the bare minimum is required for HKWorkoutBuilder to create a workout that adds time the appleExerciseTime. I couldn't find the documentation for this. This is my code so far. func createWorkoutSample( expectedActiveEnergyData: [Double], expectedExerciseMinutesData: [Double], calendar: Calendar, startDate: Date ) async throws -> [HKSample] { var testData: [HKSample] = [] let workoutConfiguration = HKWorkoutConfiguration() workoutConfiguration.activityType = .running workoutConfiguration.locationType = .outdoor let results = try await withThrowingTaskGroup(of: HKSample?.self) { group in for (index) in 0..
Search results for
calendar
1,863 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Seattle and SF are in the same time zone, so why would they have different timezoneOffset values? Also, what does -29359 even mean? It translates to -8.1527… hours, which isn’t a meaningful time zone offset. Since you are curious, this is an app I started developing in 2011, and it was beleaguered with every imaginable edge case with regard to time zones and daylight saving time. My app is all about converting solar time to whatever time zone you want to look at sometime from, in whatever calendar, in any time past or present, which often involves crossing every possible arbitrary human-made boundary in time and space. Being able to create a standardized time zone based on the location (converted to seconds from GMT), allowed me to do certain data conversions to get the day without having to worry about whether or not daylight saving was in effect at one calendar date but not another that the date picker might choose. And it worked fine for many years until the latest iOS. Presumably Apple h
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
When querying the data, we do not receive a response, and the code enters an infinite loading state without completing the request. Assuming that you meant your initialResultsHandler was never triggered after your query was executed (healthStore.execute(query)), I believe that's a HealthKit bug because, in any case, HKStatisticsCollectionQuery should call the initial results handler after a period of time; if there is an error, it should call the handler with the error. I’d hence suggest that you file a feedback report with a sysdiagnose and share your report ID here for folks to track. For the instructions of how to capture a sysdiagnose, see here. I don't see anything that can work around the issue, but for debugging purpose, I am guessing that the issue may be related to the dataset on the device's HealthKit store. You might check if the following is relevant: The anchor date components. I see that you set anchorComponents.hour to 0. I'd expect that the other components, such as anchorComponents.minute and
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags:
We have working code to fetch step data from HealthKit after requesting the necessary permissions. However, we’ve encountered an issue specific to one device, the iPhone 16 Pro Max. When querying the data, we do not receive a response, and the code enters an infinite loading state without completing the request. The user who is facing this issue has tried logging in on another device, and it works fine. On the problematic device (iPhone 16 Pro Max), the request does not complete. For reference, I’ve included the code below. Resolving this issue is crucial, so we would appreciate any guidance on what steps we can take to troubleshoot or resolve the problem on this specific device. Please note that the device has granted permission to access HealthKit data. static let healthStore = HKHealthStore() static func limitReadFromHealthKitBetweenDates(fromDate: Date, toDate: Date = Date(), completion: @escaping ([HKStatistics]) -> Void) { guard let stepsQuantityType = HKQuantityType.quantityType(forIdentifier: .step
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags:
iOS
iPhone
Health and Fitness
HealthKit
We are reaching out for guidance after encountering 2nd repeated Guideline 4.3(a) - Design - Spam rejections for our WeNote app. Here’s a brief timeline of our journey: 2018: We launched the WeNote Android app on Google Play Store. 2019: We started promoting WeNote on YouTube and began development of the WeNote iOS app. Our progress was publicly visible on our Trello board and discussed on the Apple Developer forum. August 17, 2021: We filed an official complaint with Apple regarding a *** company infringing on our app logo, title, and description. The issue was resolved when *** agreed to update their app’s branding. 2022 Year: *** company is terminated from App Store. June 2022: WeNote for iOS was officially released on the Apple App Store. June 17, 2024: We received a rejection from the Apple Review team citing Guideline 4.3(a) - Design - Spam: “We noticed your app shares a similar binary, metadata, and/or concept as apps previously submitted by a terminated Apple Developer Program account. Submitting simi
Hey team I'm facing an issue where startDate is 1 January 2025 and endDate is 31 March 2025 between this 2 dates is 90 days, but on my code is being taken as 89 days I've seen the math of the code excludes the first partial day (from midnight to 06:00) on 2025-01-01, which results in 89 full days instead of 90 days. startDate: 2025-01-01 06:00:00 +0000 endDate: 2025-03-31 06:00:00 +0000 this is my function func daysBetweenDates() -> Int? { guard let selectedStartDate = selectedStartDate?.date else { return nil } guard let selectedEndDate = selectedEndDate?.date else { return 0 } let calendar = Calendar.current let dateComponents = calendar.dateComponents([.day], from: selectedStartDate, to: selectedEndDate) return dateComponents.day } what I've tried is reset the hours to 0 so it can take the full day and return 90 days like this func daysBetweenDates() -> Int? { guard let selectedStartDate = selectedStartDate?.date else { return nil } guard let selectedEndDate = selectedEndDate?.date else { re
Topic:
Programming Languages
SubTopic:
Swift
Hello, I wasn't able to figure out how to handle multiple days with DeviceActivitySchedule. For instance, let's say the user wants to block certain apps from 9:00 AM to 12:00 AM, every day except Saturday and Sunday, how my schedule should look like? I've tried different things... This schedule works for each day of the week, but that's not my goal: let schedule = DeviceActivitySchedule( intervalStart: DateComponents(hour: 9, minute: 00), intervalEnd: DateComponents(hour: 12, minute: 00), repeats: true) And if I specify the weekDay inside the DateComponents, like this: // Gregorian calendar // 2 -> Monday // 6 -> Friday let schedule = DeviceActivitySchedule( intervalStart: DateComponents(..., weekday: 2), intervalEnd: DateComponents(..., weekday: 6), repeats: true) the schedule will block the apps from Monday at 9:00 AM to Friday at 12:00 AM, which is also not my goal. The only workaround that came to my mind was to create a different schedule for each day of the week: enum WeekDays: String, Ca
Topic:
App & System Services
SubTopic:
General
Tags:
Managed Settings
Family Controls
Device Activity
Screen Time
Right, so 72 entries is a sort-of limit. That should maybe be mentioned somewhere in the developer documentation to avoid anyone hitting issues. However, as this the Simulator and a development device those limits shouldn't apply. Anyway, thanks, but that still doesn't help. Even if I change the timeline to have just one day of 72 timeline entries (every 20 minutes for 24 hours), the widgets are still out of whack after just a few minutes. Due to the way timers work in SwiftUI, we developers are having to write a ton of fragile code to work around Apple's limited implementation. I want to show my users a countdown timer that has something like 12 days, 13:45:18. If I use the standard Text.init(date, style: .timer) I will get something like 301:45:18. The developer docs show this example: Example output: 2:32 36:59:01 Who in their right mind would ever want to see a countdown of 36 hours 59 minutes 1 second? No one. Users want to see 1 day 12 hours 59 minutes 1 second, or a friendlier 1 day, 12:59:01. And I ca
Topic:
App & System Services
SubTopic:
General
Tags:
Hi, I'm currently wrestling with the .chartXScale(domain:) modifier in order to get my Chart to display correctly. The basics of the Chart look like this. Chart(measurements, id: .timestamp) { measurement in if let total = measurement.production?.total { BarMark( x: .value( Timestamp, measurement.timestamp, unit: .weekOfYear, calendar: .current ), y: .value( Solar production, total ) ) } } As anyone familiar with Charts can see, I sort data into columns based on what week of the year the measurements belong to. Some of them can be null, and when they are, I still want space in the Chart where a BarMark would've been to be taken up, like week number 4 in this example chart (in which I've defaulted all measurements that are null in week 4 to 0, for demonstration purposes): To achieve that, as I understand, I'm meant to use the .chartXScale(domain:) modifier, but when I apply the following modifier... .chartXScale(domain: firstDayOfMonth...firstDayOfNextMonth) ... (where the domain is from the first day
I've recently gotten an app published to the IOS store. I made this app using React Native and testing through Expo Go. In Expo, everything functioned OK, but, once downloaded fully on my IPhone, one of the functions isn't working. Specifically, it's an Enter button that stores calendar information (nothing more than a date, time, and event name) through the React AsyncStorage function. Is there something wrong with AsyncStorage? For more clarity, all other touchable opacities in the app function as intended.
Topic:
Developer Tools & Services
SubTopic:
General
I have released a watchOS-specific application that retrieves data from the iPhone calendar app and displays it on the Apple Watch. It uses the calendars function in EKEventStore to retrieve the list of calendars, but it seems that it sometimes fails to retrieve iCloud calendars. Trouble is, this problem only occurs in a very few users‘ environments, the majority of other users’ environments are able to retrieve them without any problems, and I cannot reproduce it at all in my environment. Local calendars and Google calendars seem to be retrieved without any problems. Minimal example code: import SwiftUI import EventKit struct ContentView: View { let eventStore = EKEventStore() @State var success: Bool = false @State var calendarNames: [String] = [String]() func request() async { success = (try? await eventStore.requestFullAccessToEvents()) ?? false } func list() { calendarNames = eventStore.calendars(for: .event).map { $0.title } } var body: some View { V
Same problem for me. Running stable iOS 18.1.1 on an iPhone 14 Pro, and recurring reminders that I've deleted are showing up multiple times a day in Calendar.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
@darkpaw the following code is giving me the above error: struct GetIntent: ForegroundContinuableIntent { ... @Parameter var date: Date? ... } ... class MyShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: GetIntent(), phrases: [ Get (.applicationName) for (.date) ], shortTitle: Get, systemImageName: calendar) } }
Topic:
UI Frameworks
SubTopic:
General
Tags:
IOS 18 is the worst update yet, and I hope that the developers at Apple see this and make notes. The most egregious features are definitely the new control panel, emojis and the photo app. I am largely disliking the changes to the control panel: the exit button is WAY too small, and instead of swiping at the bottom to enter the new categories, would it have been difficult to instead have the user swipe left? The format is also incredibly overwhelming—whatever Apple had before was perfectly fine, I’m not sure why they touched it. The new photo app: I’m not sure why everything needs to be in the same page. It’s unnecessary and unneededly clunky. I’m not sure if Apple was going for a ’minimalist aesthetic vibe’, but the new format gives me a migraine. Please revert these changes. And, finally, the new emoji panel. I am also unsure as to why this was messed with: the old one was perfectly fine. The sizing of the emojis needs to go back to how it was before. Right now, I feel like a grandmother with -10 vision try
Topic:
Community
SubTopic:
Apple Developers
FWIW when a nasty problem with Exchanged-based calendars from iOS 18 was fixed in 18.1, it was not in the release notes either... but it was still fixed.
Topic:
Business & Education
SubTopic:
Device Management
Tags: