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

# notifyWhenInteractionChanges(_:)

Registers a block to be executed when a transition changes from interactive to non-interactive.

```
func notifyWhenInteractionChanges(_ handler: @escaping (any UIViewControllerTransitionCoordinatorContext) -> Void)
```

## Parameters

`handler`

The block to execute when the transition changes from interactive to noninteractive. The block has no return value and takes the following parameter:

## Discussion

Your handler block is executed any time the transition changes from interactive to noninteractive, including when the transition ends or is canceled. When the user cancels a transition, UIKit executes your context block, calls the [`viewWillDisappear(_:)`](/documentation/UIKit/UIViewController/viewWillDisappear(_:)) method on the presented view controller, and finally calls the [`viewWillAppear(_:)`](/documentation/UIKit/UIViewController/viewWillAppear(_:)) method on the original view controller to signal that it’s once again visible.

Use the [`isInteractive`](/documentation/UIKit/UIViewControllerTransitionCoordinatorContext/isInteractive) property of the context object to determine the current interactivity of the transition. You can also use the value of the [`isCancelled`](/documentation/UIKit/UIViewControllerTransitionCoordinatorContext/isCancelled) property to determine an appropriate course of action. For example, if the transition was canceled, you might remove any extra views that were added to the view hierarchy by a previous call to [`animate(alongsideTransition:completion:)`](/documentation/UIKit/UIViewControllerTransitionCoordinator/animate(alongsideTransition:completion:)) or [`animateAlongsideTransition(in:animation:completion:)`](/documentation/UIKit/UIViewControllerTransitionCoordinator/animateAlongsideTransition(in:animation:completion:)).

You can call this method multiple times to register multiple blocks. All of the registered blocks are executed when the transition state changes.

---

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)