<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RoomPlan",
  "identifier" : "/documentation/RoomPlan/RoomCaptureView/encode(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RoomPlan"
    ],
    "preciseIdentifier" : "c:@M@RoomPlan@objc(cs)RoomCaptureView(im)encodeWithCoder:"
  },
  "title" : "encode(with:)"
}
-->

# encode(with:)

Serializes the view to the specified coder.

```
@MainActor @preconcurrency override dynamic func encode(with coder: NSCoder)
```

## Parameters

`coder`

An object that the view serializes to.

## Overview

This property inherits from <doc://com.apple.documentation/documentation/UIKit/UIView>.

---

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)