<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIAdaptivePresentationControllerDelegate/presentationControllerDidAttemptToDismiss(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIAdaptivePresentationControllerDelegate(im)presentationControllerDidAttemptToDismiss:"
  },
  "title" : "presentationControllerDidAttemptToDismiss(_:)"
}
-->

# presentationControllerDidAttemptToDismiss(_:)

Notifies the delegate that a user-initiated attempt to dismiss a view was prevented.

```
optional func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController)
```

## Parameters

`presentationController`

The presentation controller managing the adaptivity change.

## Discussion

UIKit supports refusing to dismiss a presentation when the `presentationController`.[`isModalInPresentation`](/documentation/UIKit/UIViewController/isModalInPresentation) returns `true` or [`presentationControllerShouldDismiss(_:)`](/documentation/UIKit/UIAdaptivePresentationControllerDelegate/presentationControllerShouldDismiss(_:)) returns `false`.

Use this method to inform the user why the presentation can’t be dismissed, for example, by presenting an instance of [`UIAlertController`](/documentation/UIKit/UIAlertController).

---

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)