Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Targeting swift from Unity

Discussion in '2019.3 Beta' started by reuno, Jan 20, 2020.

  1. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    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 :'(
     
    Last edited: Jan 20, 2020
    sergioabril and Karl-Heinz like this.
  2. sergioabril

    sergioabril

    Joined:
    Jan 11, 2016
    Posts:
    33
    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#?
     
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @sergioabril > No, I ended up going a very different way.
    The lack of documentation/support on this topic was just too much.
     
    sergioabril likes this.