Contents

preferredName(for:basedOn:)

Generate a preferred name for the given attachment.

Declaration

borrowing func preferredName(for attachment: borrowing Attachment<Self>, basedOn suggestedName: String) -> String

Parameters

  • attachment:

    The attachment that needs to be named.

  • suggestedName:

    A suggested name to use as the basis of the preferred name. This string was provided by the developer when they initialized attachment.

Return Value

The preferred name for attachment.

Discussion

The testing library uses this function to determine the best name to use when saving attachment. The default implementation of this function returns suggestedName without any changes.