# Have we always been able to pass a Swift struct to Obj-C?

**URL:** <https://forums.swift.org/t/have-we-always-been-able-to-pass-a-swift-struct-to-obj-c/53675>\
**Category:** Using Swift\
**Created:** [November 24, 2021, 1:01am UTC](https://forums.swift.org/t/have-we-always-been-able-to-pass-a-swift-struct-to-obj-c/53675 "2021-11-24T01:01:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JetForMe](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jetforme/32/482_2.png) [@JetForMe](https://forums.swift.org/u/JetForMe)\
**Post date:** [November 24, 2021, 1:01am UTC](https://forums.swift.org/t/have-we-always-been-able-to-pass-a-swift-struct-to-obj-c/53675/1 "2021-11-24T01:01:12Z")

</div>

I just discovered today that I seem to be able to pass a Swift struct in a `userInfo` dictionary in a `NotificationCenter` notification. Has that always been possible, or was that added to the language later?

Because I've been going to great lengths to either avoid doing that, or to marshal the object into primitive bridged types. I'm delighted (and a bit frightened and chagrined) to learn I don't need to do that.

---

<div class="post-metadata">

**Author:** ![jrose](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jrose/32/408_2.png) [@jrose](https://forums.swift.org/u/jrose)\
**Post date:** [November 24, 2021, 1:33am UTC](https://forums.swift.org/t/have-we-always-been-able-to-pass-a-swift-struct-to-obj-c/53675/2 "2021-11-24T01:33:47Z")

</div>

Since Swift 3, I think. Swift structs get boxed up in an opaque `id`-compatible type that you can unbox with downcasts. They even pass through Hashable conformance. See [Objective-C id as Swift Any - Swift Blog - Apple Developer](https://developer.apple.com/swift/blog/?id=39) (skip down to "Swift Value Types in Objective-C").

---

<div class="post-metadata">

**Author:** ![JetForMe](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jetforme/32/482_2.png) [@JetForMe](https://forums.swift.org/u/JetForMe)\
**Post date:** [November 24, 2021, 2:05am UTC](https://forums.swift.org/t/have-we-always-been-able-to-pass-a-swift-struct-to-obj-c/53675/3 "2021-11-24T02:05:07Z")

</div>

Man. It's so easy to miss new features when they're added. I've been operating under the assumption I couldn't do that for soooo lonng.
