wayfinders / WRCalendarView

Calendar Day and Week View for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

delete event

PransiK opened this issue · comments

Is there any way to remove event from the view?

You need to do some editing to WRWeekView. I added the next function to the events mark:
public func removeEvent(event: WREvent) {
events = events.filter() { $0 !== event }
forceReload(true)
}

Then in your ViewController WRWeekViewDelegate extension, add
func selectEvent(_ event: WREvent) {
weekView.removeEvent(event: event)
}

You need to hold the event cell instead of just tapping in it in order to make selectEvent function work.