Contents

grantCapability(_:invalidationHandler:)

Grants the specified capability to the process, calling the handler when the capability becomes invalid.

Declaration

func grantCapability(_ capability: ProcessCapability, invalidationHandler: @escaping () -> Void) throws -> ProcessCapability.Grant

Parameters

  • capability:

    The capability to grant.

  • invalidationHandler:

    A closure that the system calls when the capability becomes invalid.

Return Value

A ProcessCapability.Grant object that represents the granted capability.

Discussion

When the process no longer needs the capability, call invalidate() on the returned object.

See Also

Coordinating processes