Contents

springLoadingActivated(_:draggingInfo:)

Responds to the activation or deactivation of spring-loading on a destination.

Declaration

@MainActor func springLoadingActivated(_ activated: Bool, draggingInfo: any NSDraggingInfo)

Parameters

  • activated:

    A Boolean value indicating whether spring-loading has been activated on the destination. True indicates that spring-loading has been activated. False indicates that spring-loading has been deactivated.

  • draggingInfo:

    An NSDraggingInfo object, which provides information about the drag event, including the dragged data.

Discussion

Typically, spring-loading is fully activated when a hover timeout occurs or the user finishes force clicking on a destination object to initiate spring-loading. In these cases, the springLoadingActivated:draggingInfo: method is only called once with an activated parameter value of true.

However, if the destination is configured with continuous activation (NSSpringLoadingOptions was set to NSSpringLoadingContinuousActivation), then the springLoadingActivated:draggingInfo: method is called twice. First, it’s called with an activated parameter value of true when a hover timeout occurs or the user begins force clicking on a destination object to initiate spring-loading. Then, it’s called again with an activated parameter value of false when the hover exits the destination’s bounds or the user finishes force clicking on the destination object.

See Also

Related Documentation

Respond to Spring-loading Events