Events cannot be rescheduled for a new day. This should be possible, for example, holding it on the side of the screen for several seconds

I am working on Events functions on a calendar and I am stuck on one.

Here's what I did: I have a page / interface in which the day view is displayed. The user can scroll to the next / previous day, and the same view is reloaded with information about a specific day. All this is done dynamically. In day mode, events for a specific day are displayed.

Question: I want to implement the move / Drag and Drop function for the displayed event. The user can select an event block and move it to another day. However, I cannot implement the same. I attached a screenshot of the daily view on the calendar with a visible event.

Please help me move events with an event object on different days (for example, the Iphone4 calendar). How can i do this?

enter image description here

+7
source share
2 answers

I assume that you cannot achieve the desired effect because you are tracking the movement in the event view mode or in the day mode. When you download a new Day View, your gesture recognizer loses its context. If this is your problem, the following steps may help:

  • Define a view that is a caption for a day view and does not unload when loading another day view.
  • Add your UITapGestureRecognizer, which tracks the movement of the Event View to the controller of this view.
  • Track the position of gestures when the recognizer sends events in the recognizer state of GUIGEURUERecognizerStateChanged and moves the view of events as before.
  • When the gesture position is in the desired target area for changing the day view, place the “Event” view in the new “Day View” supervision subtitle, load another “Day view” and keep the “Event” view in the foreground (and place the event data object in the context new day).
  • When the new day view is loaded, return to the method that you used to move your view of the events, now in the context of the new day view.

Based on your sketchy question and my assumptions, this is the best answer I can give. Hope this helps.

Best Peter

+2
source

The workaround would be

  • long press on an existing event
  • create a UIButton that matches exactly as an "existing event" and add to subview
  • make UIButton draggable and with target action
  • the user scrolls or projects the background calendar (date of change in the same form, that is: an existing project).
  • user clicks on UIButton, use the button position to find x, y offset along with the current date.

Good luck

0
source

All Articles