I am trying to add Swift class in one objective-c file for which I had to add *-Swift.h file in my objc file. While the project works fine in debug mode but when I try to archive my app it's throwing error saying that particularly that *-Swift.h file is not found. I tried many solutions but none of them worked. Then I got this question on apple website which is exactly the same problem but his solution which was to set precompile prefix header to YES also did not work for me. ( https://forums.developer.apple.com/thread/7512 ).
I do understand that this header is generated in derived data and build process for debug and archive is different but nothing is working in my case.
I have one framework inside which my app target is located. I am adding the header in my objc as #import "My_Project-Swift.h"
I am using XCode 10.
Here is what worked for me:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.