Search results for

calendar

1,863 results found

Post

Replies

Boosts

Views

Activity

iOS17 Bug: NSCalendar compareDate:toDate:toUnitGranularity always return "same"
in iOS 17, I found the function [compareDate:toDate:toUnitGranularity] in NSCalendar always return “same” here is the code : NSString *transformedFromDateStr = 2023-06-16; NSString *transformedToDateStr = 2023-06-20; NSDate *transformedFromDate = [NSDate dateWithString:transformedFromDateStr formatString:@yyyy-MM-dd timeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; NSDate *transformedToDate = [NSDate dateWithString:transformedToDateStr formatString:@yyyy-MM-dd timeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; NSCalendarUnit uint = NSCalendarUnitDay; NSCalendar *calendar = [NSCalendar currentCalendar]; calendar.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; //the result always return true NSComparisonResult result = [calendar compareDate:transformedFromDate toDate:transformedToDate toUnitGranularity:uint]; now before iOS 17 is right, why this happened ?
3
0
694
Aug ’23
Reply to Kernel Panics on M1 Mac on Monterrey Beta with OWC Hub
Same here. I thought is was my CalDigit TS3+. I also have a OWC Thunderbolt Hub. My issue was it was on my 2019 MacBook Pro 16 (maxed out) running Ventura. I happened to have a 14 Apple MacBook M1 Max with 64GB, so I manually migrated my apps thinking it might be a software issue. I didn't migrate the usual culprits; AVG, CleanMyMac. Sure enough My system had issues with a LaCie External HDD, connected to the OWC, that I used for TimeMachine. It wouldn't stay mounted. Then on overnights - some maybe an additional clue - I'd come in in the morning, and the M1 rebooted. Kernel panic. Details below. I also swapped out the CalDigit TS3+ for a TS4. I never thought it could be the OWC, so I'll disconnect that to see if the issue goes away. I'm going to try some attempts to isolate. OWC currently connected via CalDigit. I'm going to connect that directly. Step at a time. Crash report: `panic(cpu 2 caller 0xfffffe001b97fb18): dart-usb2 (0xfffffe200640c000): DART(DARTBLK) error: SID 1 TTBR invalid exception after shut
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’23
A system datePicker-Crash on iOS16.5.1
iPhone have a crash that will must appear on iOS16.5.1。 I submit a demo,iphone setting list as follows: iOS 16.5.1 language : French region: Tunisia Date&Time: 24-Hour Time : enable SetAutomatically : disable Time Zone : Tunisia Time : 22:02 Demo Code as follow: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 200, 200)]; [btn setTitle:@Click forState:UIControlStateNormal]; btn.backgroundColor = [UIColor blueColor]; [btn addTarget:self action:@selector(btnAction) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:btn]; } - (void)btnAction { NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; UIDatePicker *datePicker = [[UIDatePicker alloc] init]; [datePicker setCalendar:calendar]; }
2
0
561
Jul ’23
Date not fully localized with Date.FormatStyle
Is there a way using Date.FormatStyle to make the numbers also show in Hebrew the same way DateFormatter does? For some reason using Date.FormatStyle doesn't seem to have the ability to show the numbers locally. Here's some sample code, you can see that using DateFormatter the locale is respected and it displays properly but using Date.FormatStyle the numbers are still regular numbers. Update: Here's a modified version of DateFormatter. The goal is using Date.FormatStyle and getting the same result as DateFormatter import SwiftUI struct ContentView: View { let date = Date.now var body: some View { List{ Text(date.formatted(formatStyle.attributed)) .environment(.locale, Locale(languageCode: .hebrew, script: .hebrew, languageRegion: .israel)) .environment(.calendar, Calendar(identifier: .hebrew)) Text(date, format: formattttttt) .environment(.locale, Locale(languageCode: .hebrew, script: .hebrew, languageRegion: .israel)) .environment(.calendar, Calendar(identifier: .hebrew))
2
0
1.1k
Jul ’23
Reply to Date not fully localized with Date.FormatStyle
It appears that styles use the Hebrew numbering system while templates do not: let fullyHebrewLocale = Locale(identifier: he-IL@numbers=hebr) let fullyHebrewCalendar = { var calendar = Calendar(identifier: .hebrew) calendar.timeZone = TimeZone(identifier: Asia/Jerusalem)! calendar.locale = fullyHebrewLocale return calendar }() let latinHebrewLocale = Locale(identifier: he-IL@numbers=latn) let latinHebrewCalendar = { var calendar = Calendar(identifier: .hebrew) calendar.timeZone = TimeZone(identifier: Asia/Jerusalem)! calendar.locale = latinHebrewLocale return calendar }() struct ContentView: View { let date = Date.now var body: some View { List{ Text(u{2067}FSH:tu{2069} + date.formatted(formatStyleH.attributed)) .environment(.layoutDirection, .rightToLeft) Text(u{2067}DFHS:tu{2069} + dateFormattedHS(date: date)) .environment(.layoutDirection, .rightToLeft) Text(u{2067}DFHT:tu{2069} + dateFormattedHT(date: date)) .environment(.layoutDirection, .rightToLeft)
Topic: App & System Services SubTopic: General Tags:
Jul ’23
Deleting an event deletes the event on the iPhone calendar, but not on the MacBook one.
Hello! I receive events in this way: let store = EKEventStore() let predicate = store.predicateForEvents(withStart: startDate, end: endDate, calendars: nil) let events = store.events(matching: predicate) And remove one of them in this way: try store.remove(event, span: .thisEvent, commit: true) It removes event from iPhone's calendar, but does not from MacBook's. The event came from Google calendar. If I do these things with an event came from iCloud calendar, it works both on iPhone and MacBook. I have tried different ways to solve this problem but without success. I would appreciate any help.
2
0
883
Jul ’23
Reply to TN3152: Migrating to the latest Calendar access levels
Hey Jason, Was having a look into the Technote you shared and, regarding the Protect user privacy with information property list keys section, the documentation mentions the following: Important On iOS 17 or later, if your app doesn’t include usage description keys, or only includes the older NSCalendarsUsageDescription key for describing events access, iOS automatically denies any access request. But, immediately after, it mentions this: To access a person’s calendar events or reminders through EventKit or EventKit UI, your app needs to include descriptions for the following if your app links to iOS 10 or later, and runs on iOS 10 through iOS 16: NSCalendarsUsageDescription, which is a fallback if your app runs on iOS 17 or later and doesn’t include descriptions for NSCalendarsWriteOnlyAccessUsageDescription or NSCalendarsFullAccessUsageDescription. I find this very confusing as the two concepts seem to be the opposite of each other. Am I misunderstanding something or is there an issue with the docu
Topic: App & System Services SubTopic: General Tags:
Jun ’23
Control center
With watchOS 10 beta when I swipe up from the bottom of the screen of my watch I am presented with calendar events and other information instead of the control center. The control center has been moved to the side button Instead of my most used apps. Seems the information that is given when swiping from the bottom of the screen could be included in the information that is presented when swiping down from the top of the screen leaving the control center where it has always been and my most used apps on the side button. As it is now I have to push the Digital Crown and scroll through the list of apps to find the app I want. Not very intuitive.
2
0
330
Jun ’23
Full calendar access needed to display event details that my app created?
Hello, I watched the EventKit session from WWDC 23 (https://developer.apple.com/videos/play/wwdc2023/10052/) that details the new permission changes. The ability to have just write access to the calendar is great, however my app also offers the user to view the already created event and to possibly edit it further via EKEventEditViewController. The event in question is release date of a videogame, so there might be needs for edit and based on saved event identifier, I am able to show different icon to let the user know that event exists. When the user taps on the icon, I use the eventStore.event(withIdentifier:. So I guess I will need the new full access with new prompt API to keep my functionality? Is there any possibility that this will change and apps would be able to query event they created? Thanks
1
0
1.9k
Jun ’23
Reply to Full calendar access needed to display event details that my app created?
Unfortunately the entire write-only access feature is the right answer to the wrong question. No person and no app ever wants to add an event to a calendar. We may talk about adding an event colloquially, but what we mean is: Add the event if it is not already there. If the event is already there, modify it if necessary. For a human example: when you confirm a meeting and say I will put it in the diary, that does not mean that you open your diary, see the meeting is already in the diary, and then add it a second time. But that is what the assumptions behind the new API imply. In my case the app is maintaining a one-a-day list of future events for the next 365 days (it does this in a separate calendar with a separate name, not in Home or Work). Each time the app is run it needs to add whatever future dates have not yet been added. The new API does not allow this because there is no way of knowing what has already been added. In addition (in parallel to your case): the exact content of the eve
Topic: App & System Services SubTopic: General Tags:
Jun ’23
iOS system panic, panic string Kernel data abort
Our user reported lately that their devices were rebooted automatically after using our app for more than 2 hours , at the beginnig I cannot , I never seen an app will make the iOS system get rebooted, until our user send me a video prove it what they said is true.And after that I asked them for the panic-full logs in their devices which indicate the device was rebooted unusually, the log shows that it's exactly our app's process leads to the reboot, OMG, I got shocked...Our app is a live broadcasting app, most of our users encountered the reboot problem are when they finished broadcasting a live for a long time (maybe more than 2 hours) and close the room button, another infomation is that we add WebRTC.framework to our app lately, Our user's devices and system version vary, so maybe there is no relation with these factors.I reproduce this problem once on my iPhone 7P (I boradcasted for 2 hours, my phone rebooted exactly after I clicked the close button of my live room), and the panic log in my phone is very
6
0
14k
Jun ’23
watchOS 9 WidgetKit complications missing com.apple.developer.healthkit entitlement
I have an iOS/wOS app that launched last year. Now I want to add complications to it and use the new way of doing complications with WidgetKit. I have everything in place up to the point where I'm supposed to read the data from Health to display it, where it fails with Missing com.apple.developer.healthkit entitlement. This is the new extension I've added It's embedded in the WatchKit app NOT in the WatchKit Extension and I've added permission to read health data directly in the info.plist for the extension I pull the data from the TimelineProvider protocol method func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { let currentDate = Date() var entries: [WorkoutEntry] = [] ComplicationHealthManager.loadPreviousWorkouts { workout in let workoutEntry = WorkoutEntry(date: currentDate, workout: workout) entries.append(workoutEntry) let timeline = Timeline(entries: entries, policy: .after(currentDate)) completion(timeline) } } with the help of a small manager class class ComplicationH
2
0
1.3k
Jun ’23
Reply to Parsing Dates Without Times
I found this explanation very useful in the context of debugging an off-by-one-day bug in my crossword app. It's a classic scenario where crosswords are referenced by date but without a specific time, except that the date is usually reckoned by the time zone of the host publication. I thought I would share an example of how I'm addressing the issue using the defaultDate technique, but generalizing it to choose a middle of the day time that should work with whatever time zone (Quinn's example uses a fixed relative time interval that is specific to Sao Paolo). Given a date formatter that already has the desired time zone set on it: var midDayComponents = DateComponents(hour: 12) midDayComponents.calendar = Calendar(identifier: .gregorian) midDayComponents.timeZone = dateFormatter.timeZone dateFormatter.defaultDate = midDayComponents.date It seems that all you need is an hour, a calendar, and a time zone to come up with a suitably mid-day date. I hope this helps somebody!
Topic: App & System Services SubTopic: General Tags:
Jun ’23
Date attribute syncing across core data objects
I have been creating an app, and when I save the core data, I give two attributes, they are String and Date types. For some reason, the date attribute syncs across all the objects I save, while the time attribute is just fine. ContentView code is: import Foundation import SwiftUI import CoreData struct ContentView: View { @Environment(.managedObjectContext) private var viewContext @FetchRequest(entity: Time.entity(), sortDescriptors: []) private var times: FetchedResults<Time> ... var body: some View { VStack{ Text(Cube App) .font(.largeTitle) .fontWeight(.bold) .padding(.top, 4.0) Text(scrambles.randomElement()!) .font(.title) .fontWeight(.semibold) .multilineTextAlignment(.center) .padding([.top, .leading, .trailing]) if start{ Stopwatch(progressTime: $elapsedTime, isRunning: $timerRunning) .padding(.top) .fontWeight(.bold) .onAppear{ timerRunning = true toggleStartStop() } } Button(startstop){ toggleStart() if start == false{ saveTime = elapsedTime elapsedTime = 0 timerRunning = false stopTime() togg
3
0
1.2k
Jun ’23