Open MadalinSava opened 1 year ago
Are you having any issues because of this?
Kind of, when the event is updated the app is reacting to changes. Right now there's no visible issue but I will add some more functionalities around this.
A simple solution would be to use a weak reference to editedEventView
in TimelinePagerView:370
(for the completionHandler
in the commitEditing
function, and add a guard to unwrap it. The second time the completion handler is called is should be nil since after the first call to dayView(dayView:didUpdate)
I'm calling endEventEditing()
.
Would you be able to implement this change? To clarify, you experience this issue in the scenario of long pressing an event, editing it and then long pressing the timeline?
Long press into drag and drop (without releasing the touch in between). I'll add this to my todo list, should be a simple fix but need to test it thoroughly.
Feel free to propose the PR at this stage, so that I could test it as well. I also recommend testing with https://github.com/richardtop/CalendarApp since it's an end-to-end implementation of the calendar instead of the one embedded into this application.
When I drag an event after long-pressing it (without releasing!), after dropping it I'm seeing the delegate function always called twice. This is caused by the snap animation in
commitEditing
. What happens on mouse release:handlePanGesture
is called and since the state is ended, it calls commitEditingtimelineDidLongPress
is callededitedEventView
is still there (animation did not finish andcompletionHandler
was not called to set it to nil), the animation starts again