---
title: "shadowImage(forToolbarPosition:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitoolbar/shadowimage(fortoolbarposition:)"
---

# shadowImage(forToolbarPosition:)

Returns the image to use for the toolbar shadow in a given position.

## Declaration

```swift
func shadowImage(forToolbarPosition topOrBottom: UIBarPosition) -> UIImage?
```

## Parameters

- `topOrBottom`: A toolbar position constant. You can use this parameter to indicate whether the shadow image returned is intended for use in a toolbar at the top or bottom of the view.

## Return Value

Return Value The image to use for the toolbar shadow in the position specified by topOrBottom.

## Discussion

Discussion The default value is nil, which corresponds to the default shadow image being used. When non-nil, the return value represents the shadow that is used on the toolbar in the position specified by the topOrBottom parameter.

## See Also

### Adding a shadow

- [setShadowImage(_:forToolbarPosition:)](uikit/uitoolbar/setshadowimage(_:fortoolbarposition:).md)
