<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DiskImageKit",
  "identifier" : "/documentation/DiskImageKit/DiskImage/CreationConfiguration/asifLayer(url:type:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "DiskImageKit"
    ],
    "preciseIdentifier" : "s:12DiskImageKit0aB0C21CreationConfigurationPA2A09ASIFLayerdE0VRszrlE9asifLayer3url4typeAG10Foundation3URLV_AC0H4TypeVtFZ"
  },
  "title" : "asifLayer(url:type:)"
}
-->

# asifLayer(url:type:)

Returns an Apple sparse image format (ASIF) configuration for stackable layers.

```
static func asifLayer(url: URL, type: DiskImage.LayerType) -> Self
```

## Parameters

`url`

The <doc://com.apple.documentation/documentation/Foundation/URL> for the disk image file.

`type`

The type of layer (cache or overlay).

## Return Value

An [`ASIFLayerCreationConfiguration`](/documentation/DiskImageKit/ASIFLayerCreationConfiguration) instance for stacking use.

## Discussion

The following example demonstrates how to append a new cache layer to a base image:

```
var stackedImage = try baseImage.appending(.asifLayer(url: cacheURL, type: .cache))
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)