---
title: "pathForImageResource(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/bundle/pathforimageresource(_:)"
---

# pathForImageResource(_:)

Returns the location of the specified image resource file.

## Declaration

```swift
func pathForImageResource(_ name: NSImage.Name) -> String?
```

## Parameters

- `name`: The name of the image resource file, without any pathname information. Including a filename extension is optional.

## Return Value

Return Value The absolute pathname of the resource file or nil if the file is not found.

## Discussion

Discussion Image resources are those files in the bundle that are recognized by the NSImage class, including those that can be converted using the Image IO framework.

## See Also

### Related Documentation

- [path(forResource:ofType:)](foundation/bundle/path(forresource:oftype:).md)

### Finding image resources

- [urlForImageResource(_:)](foundation/bundle/urlforimageresource(_:).md)
- [image(forResource:)](foundation/bundle/image(forresource:).md)
