---
title: "Discussion on \"UIViewRepresentables must be value types\" | Hashnode"
description: "Discussion on \"UIViewRepresentables must be value types\". At work, I inherited some SwiftUI code to maintain. The following code is simplified.\nfinal class MySwiftUIViewWrappingUIView: UIViewRepresentable {\n    // ...\n}\n\nThe existing code works fine running on iOS 15. But running the same code on iOS 16 wil..."
url: "https://hashnode.com/posts/uiviewrepresentables-must-be-value-types/645315da00237207c7876081"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [UIViewRepresentables must be value types](https://blog.eidinger.info/uiviewrepresentables-must-be-value-types?utm_source=hashnode&utm_medium=feed)

At work, I inherited some SwiftUI code to maintain. The following code is simplified. final class MySwiftUIViewWrappingUIView: UIViewRepresentable { // ... } The existing code works fine running on iOS 15. But running the same code on iOS 16 wil...

May 4, 2023 · 1 min read · blog.eidinger.info  
Read the article

-   [#swiftui](https://hashnode.com/tag/swiftui)
-   [#ios](https://hashnode.com/tag/ios)

## Written by

[Marco Eidinger](https://hashnode.com/@MarcoEidinger)

@MarcoEidinger

  
[View profile](https://hashnode.com/@MarcoEidinger)

#Swift #iOS SDK architect 🇺🇸 🇩🇪

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸

## Responses 1

Markdown supported · ⌘↵ to post

[Igor](https://hashnode.com/@igor1309)

[May 4, 2023](https://hashnode.com/posts/uiviewrepresentables-must-be-value-types/645315da00237207c7876081/comment/64538243312059f80873f10c)

And yet you write “Code using a struct conforming to View will compile but will cause a runtime exception…” ))

[Marco Eidinger](https://hashnode.com/@MarcoEidinger)

[May 4, 2023](https://hashnode.com/posts/uiviewrepresentables-must-be-value-types/645315da00237207c7876081/comment/64538243312059f80873f10c#reply-64539291b7c65bffda760c50)

Thanks for pointing out my mistake. I corrected the text and wrote "Code using a spinal class conforming to View will compile but will cause a runtime exception…"

[Igor](https://hashnode.com/@igor1309)

[May 4, 2023](https://hashnode.com/posts/uiviewrepresentables-must-be-value-types/645315da00237207c7876081/comment/64538243312059f80873f10c#reply-6453994e913caa000bc47a9d)

[Marco Eidinger](https://hashnode.com/@MarcoEidinger) could you please clarify what “spinal class” means?

[Marco Eidinger](https://hashnode.com/@MarcoEidinger)

[May 4, 2023](https://hashnode.com/posts/uiviewrepresentables-must-be-value-types/645315da00237207c7876081/comment/64538243312059f80873f10c#reply-645399c2b7c65bffda760d38)

[Igor](https://hashnode.com/@igor1309) final class
