---
title: dismiss()
framework: messages
role: symbol
role_heading: Instance Method
path: messages/msmessagesappviewcontroller/dismiss()
---

# dismiss()

Dismisses the extension and marks it for termination.

## Declaration

```swift
func dismiss()
```

## Discussion

Discussion Call this method to dismiss the extension. The system displays the keyboard if there is any content in the Messages app’s input field. If the input field is empty, the system dismisses the keyboard entirely. This method also marks the extension as eligible for termination, causing the system to call the view controller’s willResignActive(with:) and didResignActive(with:) methods.

## See Also

### Managing the Extension’s State

- [activeConversation](messages/msmessagesappviewcontroller/activeconversation.md)
- [willBecomeActive(with:)](messages/msmessagesappviewcontroller/willbecomeactive(with:).md)
- [didBecomeActive(with:)](messages/msmessagesappviewcontroller/didbecomeactive(with:).md)
- [willResignActive(with:)](messages/msmessagesappviewcontroller/willresignactive(with:).md)
- [didResignActive(with:)](messages/msmessagesappviewcontroller/didresignactive(with:).md)
