<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSImage/isValid",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSImage(py)valid"
  },
  "title" : "isValid"
}
-->

# isValid

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

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

## 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 <doc://com.apple.documentation/documentation/Swift/false>.

## See Also

[`init(byReferencingFile:)`](/documentation/AppKit/NSImage/init(byReferencingFile:))

Initializes and returns an image object using the specified file.

[`init(byReferencing:)`](/documentation/AppKit/NSImage/init(byReferencing:))

Initializes and returns an image object using the specified URL.



---

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)