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

# layer(url:type:)

Creates a configuration object for a new Apple sparse image format (ASIF) disk image layer.

```
static func layer(url: URL, type: DiskImage.LayerType) -> ASIFLayerCreationConfiguration
```

## Parameters

`url`

The <doc://com.apple.documentation/documentation/Foundation/URL> for a file that’s the backing store of the image.

`type`

The [`DiskImage.LayerType`](/documentation/DiskImageKit/DiskImage/LayerType-swift.struct) of the layer to create (a cache or overlay layer with an optional block count).

## Return Value

An [`ASIFLayerCreationConfiguration`](/documentation/DiskImageKit/ASIFLayerCreationConfiguration) that you can use` for stacking operations.

## Discussion

Use this factory method to create a configuration that can be used with [`appending(_:)`](/documentation/DiskImageKit/DiskImage/appending(_:)-3pfqg).
Use the configuration this method returns only for appending to stacked images, not for standalone image creation.

For more information on ASIF layer creation for stacked images, see [`asifLayer(url:type:)`](/documentation/DiskImageKit/DiskImage/CreationConfiguration/asifLayer(url:type:)) .

---

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)