5

I have reach experience in iOS native app development, My company have a unity app. Unity app developer exported the app for iOS and shared with me. I wanted to use my own created cocoa-pod library (which I have already using in my another iOS App) into Unity iOS project.

So Unity developer exported by File -> Build Settings, choose iOS and click Build, and now I am trying integrated pod (which is written in Swift 4.2) into Unity exported of iOS project.

I have taken medium post and many more reference, I have implemented the same as conclusive direction. Please look the attached screenshot below.

Reference - https://medium.com/ios-os-x-development/swift-and-objective-c-interoperability-2add8e6d6887

enter image description here

Please look the below screenshot for autogenerated file

enter image description here

Now when I am going to import this autogenerated header file to make connection between Objective C to Swift, then it is showing error as attached screenshot below

enter image description here

Please help me to resolve this issue. Thanks in advance.

VipinYadav
  • 808
  • 4
  • 16
  • 1
    You can follow this below link [this](https://stackoverflow.com/questions/24102104/how-can-i-import-swift-code-to-objective-c) – Narendra Jagne Apr 08 '20 at 07:41

1 Answers1

0

One thing that has hung me up on this in the past is if you get an error during the initial build, then sometimes it doesn't create the -swift.h file and then subsequent builds also get an error that it's missing. Make sure you've deleted your derived data and cleaned the build folder to reset so everything gets built from the beginning.

Julien S.
  • 214
  • 3
  • 9
  • I am not getting initial build error, I build the app successfully and its creates the -swift.h file ad i highlighted in attached screenshot. Now When I am going to import the -swift.h , then its showing error. I have no issue in doing the same and there is not error, if this app is not unity exported ios app. Native iOS have no issue. I think, this issue is only with unity exported app. – VipinYadav Apr 27 '20 at 02:18