Contents

init(updateHandler:)

Creates a new hinge interaction with the provided update handler.

Declaration

init(updateHandler: @escaping (UIHingeInteraction, UIHingeInteraction.Update) -> Void)

Parameters

  • updateHandler:

    Called with the initial hinge state and on each subsequent update for the interaction.

Discussion

The handler is invoked with the initial hinge state, and again whenever there is an update. An update can occur due to the hinge changing, or when the interaction moves between hierarchies. The handler is stored and escapes, so take care to avoid retain cycles.