numberOfValidItemsForDrop
The number of valid items for a drop operation.
Declaration
@MainActor var numberOfValidItemsForDrop: Int { get set }Discussion
During draggingEntered: or draggingUpdated:, you are responsible for returning the drag operation. In some cases, you may accept some, but not all items on the dragging pasteboard. (For example, your application may only accept image files.)
If you only accept some of the items, set this property to the number of items accepted so the drag manager can update the drag count badge.
When updateDraggingItemsForDrag(_:) is called, you should set the image of non-valid dragging items to nil. If none of the drag items are valid then you should not updateItems:, simply return NSDragOperationNone from your implementation of draggingEntered: and, or draggingUpdated: and do not modify any drag item properties.