Contents

cancelInteractiveTransition()

Tells the collection view to cancel an interactive transition and return to its original layout object.

Declaration

func cancelInteractiveTransition()

Discussion

Call this method after a call to the startInteractiveTransition(to:completion:) method and after you determine through a gesture recognizer or other event-handling code that the user wants to revert to the collection view’s original layout. This method removes the intermediate transition layout object from the collection view and reinstalls the original layout object. It then performs any final animations to get the collection view’s items from their current positions to the positions specified by the original layout object.

After calling this method, you can also remove the gesture recognizer or event-handling code you installed to manage the interactive portions of the transition.

See Also

Changing the layout