---
title: StackedImage
framework: diskimagekit
role: symbol
role_heading: Protocol
path: diskimagekit/stackedimage
---

# StackedImage

The protocol for stacked disk images that contain multiple layers.

## Declaration

```swift
protocol StackedImage : DiskImage
```

## Overview

Overview A stacked disk image combines multiple layers into a single logical disk image. The first layer (the bottom of the stack) is the base layer, and subsequent layers are either cache or overlay layers that modify or cache the layers beneath. The following example demonstrates how to create a stacked image. let baseImage = try DiskImage(opening: .open(url: baseImageURL)) var stackedImage = try baseImage.appending(.asifLayer(url: cacheURL, type: .cache)) stackedImage = try stackedImage.appending(.asifLayer(url: shadowURL, type: .overlay))

## Topics

### Instance Properties

- [layers](diskimagekit/stackedimage/layers.md)

## Relationships

### Inherits From

- [DiskImage](diskimagekit/diskimage.md)

## See Also

### Essential Types

- [DiskImage](diskimagekit/diskimage.md)
- [OpenConfigurationProtocol](diskimagekit/openconfigurationprotocol.md)
- [OpenConfiguration](diskimagekit/openconfiguration.md)
- [OpenConfiguration.Mode](diskimagekit/openconfiguration/mode-swift.enum.md)
