Targeting swift from Unity

Before 2019.3, it used to be relatively easy to target Swift classes from Unity (triggering Swift methods from Unity, not the other way around), through a bridging header and a C wrapper. Sure it’d take a bit of setup on xcode, but that could be easily automated via a post processor.

But I haven’t been able to do that in 2019.3. I managed to work around the deprecated methods in PBXProject (which I don’t think are related), but I keep hitting a wall as far as bridging is concerned.

I’ve read all the documentation and threads I could without finding anything relevant. I understand it may not be the most common usecase but when trying to target iOS’s latest features, I can’t really think of another way of doing things.

Is there an example of Unity to Swift communication for 2019.3 available somewhere?

tl;dr : this sort of thing used to work, doesn’t anymore, makes me very sad :cry:

2 Likes

I hit the same wall, and can’t get my head around it.
@reuno Did you find a way to call Native Swift from Unity C#?

@sergioabril > No, I ended up going a very different way.
The lack of documentation/support on this topic was just too much.

1 Like