<!--
{
  "availability" : [
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKInterfaceImage/setImageData(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKInterfaceImage(im)setImageData:"
  },
  "title" : "setImageData(_:)"
}
-->

# setImageData(_:)

Sets the displayed image using a formatted data object.

```
func setImageData(_ imageData: Data?)
```

## Parameters

`imageData`

A data object containing the image data in its native format. Specifying `nil` removes the existing image, causing the watch interface to display nothing in the space previously occupied by the image.

## Discussion

This method changes the image being displayed.

When setting images, always try to use images that are sized to fit the available space. Images are rendered according to the mode and size attributes you set for the image interface object.

---

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)