Posts

Post not yet marked as solved
0 Replies
953 Views
I am trying to add time sensitive notifications to my task/reminder app, but I am having some difficulty. Here is the code I am using currently: let center = UNUserNotificationCenter.current() let content = UNMutableNotificationContent() content.title = "Productivi" // that's the name of the app content.body = "\(taskObject.content)" //task content content.categoryIdentifier = "TASK_REMINDER" if #available(iOS 15,*) { print("Using ios 15 for set notification") content.interruptionLevel = .timeSensitive } For the adding notification request, that part works, however when the notification shows up, it isn't a time sensitive one. (I was testing in simulator and on my phone both running iOS 15.4) I can't figure out what else there is I have to do in order to enable the feature. I've done everything it says to do, is their an entitlement or capability I have to add. If so, what is it called and can some one please give me detailed steps on how to add that for local notifications in XCODE? Thank you, -Rohan
Posted
by roroCoder.
Last updated
.
Post not yet marked as solved
1 Replies
1.6k Views
I have been playing around with EventKit recently and I added a fetch request for all Events in my calendar. But after like 20 seconds after launch, I get this error: Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:56:13.202792+0200 Assisty[1779:332215] Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:57:03.745222+0200 Assisty[1779:332215] [error] precondition failure: setting value during update: 1560 I am a beginner to Xcode debugging and SwiftUI, but I can see that it thinks I have mutated something when I haven't. My app only fetches events from the user calendar and stores it in a variable of type [EKEvent]. I have no idea why this error is happening and my app is crashing left and right for no clear reason. If any one has seen this error and knows how to fix this I would really appreciate the help. Thanks a lot
Posted
by roroCoder.
Last updated
.
Post not yet marked as solved
0 Replies
473 Views
I am creating a to-do list app for my self and playing around with swiftUI, but I can't figure out how to edit an attribute of a record (if the entry is complete or not) I am trying to mark the record as complete from inside a modal/sheet view and I have access to the UUID of the record, but each time I try to fetch request all entries with UUID equal to the one I have from main view, it says I can't access a value that hasn't been assigned because I am importing it from another view that got the UUID from an original fetchRequest. Btw I'm trying to do this in SwiftUI which is why I'm asking here because online it's all answers in how to do it with earlier versions of Swift. Thanks, roroCoder
Posted
by roroCoder.
Last updated
.
Post not yet marked as solved
4 Replies
1.1k Views
My question is how to take this code: var now = Date() And get the beginning of that date. Let's say that Date() return March 17, 2021, 9 pm: 47 : 32 . How would you take that and get March 17, 2021, 12 am : 00 : 00? Also, my aim is to get code that works in SwiftUI because every other online forum I searched had out dated results for UIkit or Swift 3. Thank you, Rorocoder
Posted
by roroCoder.
Last updated
.
Post not yet marked as solved
1 Replies
699 Views
Hey guys, I'm in the middle of creating an app, and what I need is kinda hard to explain, but this is it: During a Fetch Request from Core Data, using a predicate I want to only get results are within the beginning of today (year, month, date, hour: 0, minute: 0, second: 0 ...) the end for the same year, month and date but at hour: 23, minute 59 and second 59. I basically want to see if the date received through the fetch request is in between those two times. The problem is I can't figure out how to do it. Can someone please help, I have spent the past two days searching Apple documentation (which needs to be clearer for everyone's sake) and hundreds of forums. The only problem is all the methods are out of date and I can't find a cohesive solution for use in Swift 5 and SwiftUI frameworks. Thank you. If you know how to do this, I am literally begging you to answer.
Posted
by roroCoder.
Last updated
.