---
title: isValid
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsimage/isvalid
---

# isValid

A Boolean value that indicates whether it is possible to draw an image representation.

## Declaration

```swift
var isValid: Bool { get }
```

## Discussion

Discussion If you created the image with an existing image file, but the corresponding image data is not yet loaded into memory, this method loads the data and expands it as needed. If the receiver contains no image representations and no associated image file, this method creates a valid cached image representation and initializes it to the default bit depth. If the file or URL from which the image was initialized is nonexistent, or the data in an existing file is invalid, this method returns false.

## See Also

### Related Documentation

- [init(byReferencingFile:)](appkit/nsimage/init(byreferencingfile:).md)
- [init(byReferencing:)](appkit/nsimage/init(byreferencing:).md)

### Managing Drawing Options

- [backgroundColor](appkit/nsimage/backgroundcolor.md)
- [capInsets](appkit/nsimage/capinsets.md)
- [resizingMode](appkit/nsimage/resizingmode-swift.property.md)
- [NSImage.ResizingMode](appkit/nsimage/resizingmode-swift.enum.md)
