Changes the collection view’s current layout using an interactive transition effect.
- iOS 7.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The new layout object for the collected views. This is the layout that you want the collection view to use after the interactive transition is done.
A completion handler to execute after the transition finishes.
The intermediate transition layout object responsible for managing the interactive transition behavior.
Call this method when you want to change the layout of your collection view using an intermediate transition. When you call this method, the collection view quietly makes the returned transition layout object its current layout object. It is your responsibility to set up a gesture recognizer or other touch-event handling code to track the transition progress. As progress changes, update the
transition property of the transition layout object and invalidate the layout. Invalidating its layout causes the transition layout object to update the position of items based on the new progress value.
When your event-handling code determines that the user has finished the transition to the new layout, call the
finish method. If your code determines that the user has canceled the transition, call the
cancel method to revert the changes instead. Calling either of these methods removes the transition layout object from the collection view and installs the appropriate target layout object.
This method returns an instance of the
UICollection class by default. If you want it to return a custom transition object instead, implement the
collection method of your collection view delegate and use that method to return your custom object.