Bundle

extension Bundle
  • Get the filePath for a resource in a bundle.

    Declaration

    Swift

    public func resourceFilePath(in bundle: String, for filename: String) -> String

    Parameters

    bundle

    Name of the bundle packaged with this App/Framework Bundle

    filename

    The filename of the resource in the bundle

    Return Value

    Absolute filePath to the Resources in the bundle

  • Get the filePath for a test resource in a bundle.

    Declaration

    Swift

    public func testResourceFilePath(in bundle: String, for filename: String) -> String

    Parameters

    bundle

    Name of the bundle packaged with this Test Bundle

    filename

    The filename of the resource in the bundle

    Return Value

    Absolute filePath to the Resources in the bundle