Contents

reclaimItem(_:replyHandler:)

Reclaims an item, releasing any resources allocated for the item.

Declaration

func reclaimItem(_ item: FSItem, replyHandler reply: @escaping  @Sendable ((any Error)?) -> Void)
func reclaimItem(_ item: FSItem) async throws

Parameters

  • item:

    The item to reclaim.

Discussion

::::: Swift ::::::::::

  • reply: A block or closure to indicate success or failure. If removal fails, pass an error as the one parameter to the reply handler. If removal succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally.

::::::::::::::::::::

::::: ObjC ::::::::::

  • error: A block or closure to indicate success or failure. If removal fails, pass an error as the one parameter to the reply handler. If removal succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally.

::::::::::::::::::::

Discussion

FSKit guarantees that for every FSItem returned by the volume, a corresponding reclaim operation occurs after the upper layers no longer reference that item. To use this behavior, call tryReclaim(_:) in your implementation of this method.

See Also

Working with items