---
title: cancelEditing()
framework: eventkitui
role: symbol
role_heading: Instance Method
path: eventkitui/ekeventeditviewcontroller/cancelediting()
---

# cancelEditing()

Ends the editing session and discards any changes that were made to the event.

## Declaration

```swift
func cancelEditing()
```

## Discussion

Discussion This method is the programmatic equivalent of the user tapping Cancel. The delegate won’t receive the eventEditViewController(_:didCompleteWith:) message, so you must dismiss the controller after calling this method.
