<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Messages",
  "identifier" : "/documentation/Messages/MSMessagesAppViewController/didCancelSending(_:conversation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Messages"
    ],
    "preciseIdentifier" : "c:objc(cs)MSMessagesAppViewController(im)didCancelSendingMessage:conversation:"
  },
  "title" : "didCancelSending(_:conversation:)"
}
-->

# didCancelSending(_:conversation:)

Invoked when the user deletes a message object from the Messages app’s input field.

```
func didCancelSending(_ message: MSMessage, conversation: MSConversation)
```

## Parameters

`message`

The deleted message object.

`conversation`

The conversation that the user is currently viewing in the Messages app.

## Discussion

Override this method to respond when a message is canceled. This method is called if you use the conversation’s [`insert(_:completionHandler:)`](/documentation/Messages/MSConversation/insert(_:completionHandler:)-3g248) method to add an [`MSMessage`](/documentation/Messages/MSMessage) object to the Messages app’s input field, and the user subsequently deletes the message object.

The system does not call this method if the controller’s [`presentationStyle`](/documentation/Messages/MSMessagesAppViewController/presentationStyle) property is [`MSMessagesAppPresentationStyle.transcript`](/documentation/Messages/MSMessagesAppPresentationStyle/transcript), or if its [`presentationContext`](/documentation/Messages/MSMessagesAppViewController/presentationContext) property is [`MSMessagesAppPresentationContext.media`](/documentation/Messages/MSMessagesAppPresentationContext/media).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)