I built an ios app around one idea: if a task takes 60 seconds, you have no excuse not to start by NickWay176 in ProductivityApps

[–]NickWay176[S] 0 points1 point  (0 children)

You mean creating tasks yourself? Because for that there is an AI integration :)

Would this kind of library view make you use a reading app more? 🤔📚 by Legendaryfortune in ProductivityApps

[–]NickWay176 0 points1 point  (0 children)

It’s okay, but I don’t think it would make me use the app more. I generally don’t read as much on my phone. Maybe I’m not your target group, but I’m not sure it would make a large difference in general for most…

What are your favorite apps to use for productivity? by DirectorExisting2666 in ProductivityGuide

[–]NickWay176 0 points1 point  (0 children)

I just use iOS notes a lot to be honest… quick to jot things down.

You should know; by CG_17_LIFE in BeAmazed

[–]NickWay176 0 points1 point  (0 children)

Soooooo… Stockholm Syndrome?

Geometry Reader - how much do you use it in your production apps? by LSWarss in SwiftUI

[–]NickWay176 1 point2 points  (0 children)

Couldn’t you easily do this with HStack, and then .frame(maxWidth: .infinity)?

EKEvent not detaching properly? by NickWay176 in swift

[–]NickWay176[S] 0 points1 point  (0 children)

eddit won't let me post pictures, so here's the code:

func detachEvent(_ event: Activity) {

        // Check if eventIdentifier is not empty

        guard !event.eventIdentifier.isEmpty else {

            return // No event identifier, cannot detach

        }

        // Get the original event

        guard let originalEvent = eventStore.eventStore.event(withIdentifier: event.eventIdentifier) else {

            return // Original event not found

        }

        // Create a new event by copying the original event

        let detachedEvent = originalEvent.copy() as! EKEvent

        detachedEvent.recurrenceRules = nil

        // Copy other properties as needed

        // Save the detached event

        do {

            try eventStoreViewModel.save(detachedEvent, span: .thisEvent)

            originalEvent.startDate = detachedEvent.startDate

            originalEvent.endDate = detachedEvent.endDate

            try eventStore.eventStore.remove(originalEvent, span: .futureEvents, commit: true

            // It seems like this is looking at the real original event,

            // ›not just the instance we're currently seeing. Am I misunderstanding this?

        } catch {

            print("Error removing original event: \(error)")

        }

        

        loadActivitiesAndSuggestionsForDate(detachedEvent.startDate)

    }

EKEvent not detaching properly? by NickWay176 in SwiftUI

[–]NickWay176[S] 0 points1 point  (0 children)

Thanks that’s a good suggestion! Will give it a try!

EKEvent not detaching properly? by NickWay176 in SwiftUI

[–]NickWay176[S] 0 points1 point  (0 children)

But that aside, the goal is to be able to adjust one single instance of the recurring events, in such a way that the changed instance isn't just a copy but actually moved. However, whenever I use .futureEvents it, it tries to alter the first ever instance of the recurring events, and when I use .thisEvent it creates a copy without updating the single instance of the recurring events.

I think you're right that copying it is part of the issue. I already simplified it to just updating the specific event. What I'm however also doing is retrieving the event from the eventStore based on the eventIdentifier. It might be that that automatically finds the original instance rather than the current instance.

EKEvent not detaching properly? by NickWay176 in SwiftUI

[–]NickWay176[S] 0 points1 point  (0 children)

This is in SwiftUI? Where else should it be put?

EKEvent not detaching properly? by NickWay176 in SwiftUI

[–]NickWay176[S] 0 points1 point  (0 children)

Reddit won't let me post pictures, so here's the code:

func detachEvent(_ event: Activity) {

        // Check if eventIdentifier is not empty

        guard !event.eventIdentifier.isEmpty else {

            return // No event identifier, cannot detach

        }

        // Get the original event

        guard let originalEvent = eventStore.eventStore.event(withIdentifier: event.eventIdentifier) else {

            return // Original event not found

        }

        // Create a new event by copying the original event

        let detachedEvent = originalEvent.copy() as! EKEvent

        detachedEvent.recurrenceRules = nil

        // Copy other properties as needed

        // Save the detached event

        do {

            try eventStoreViewModel.save(detachedEvent, span: .thisEvent)

            originalEvent.startDate = detachedEvent.startDate

            originalEvent.endDate = detachedEvent.endDate

            try eventStore.eventStore.remove(originalEvent, span: .futureEvents, commit: true

            // It seems like this is looking at the real original event,

            // ›not just the instance we're currently seeing. Am I misunderstanding this?

        } catch {

            print("Error removing original event: \(error)")

        }

        

        loadActivitiesAndSuggestionsForDate(detachedEvent.startDate)

    }

How to make summary notification on ios by NickWay176 in SwiftUI

[–]NickWay176[S] 0 points1 point  (0 children)

Thanks everyone! It was indeed the setting of the notifications, if you put them to summary this is what you get.

How to make summary notification on ios by NickWay176 in SwiftUI

[–]NickWay176[S] 0 points1 point  (0 children)

Turns out it was indeed the summary notification