0

I have an existing Objective-C Project that I am making into a Swift Project.

That is I have a lot of Objective-c code that I will keep and Swifting away going forward.

I have managed to create and import almost everything, but the PCH file is giving me problems.

First step is just to use the x-Prefix.pch file from objc in same project and then afterwards from Swift.

When I reference something like typedef or "#define" in the PCH file it can not see it?

  1. I have added the "Prefix Header" to the target
  2. Set "Precompile Prefix Header" to "YES"

Lastly the compiler do find the xx-Prefix.pch file but I can not use any define or typedef in code elsewere.

Do you know how?

Chris G.
  • 23,930
  • 48
  • 177
  • 302
  • Are you talking about using the prefix header from Swift code? – Sulthan Aug 30 '16 at 12:59
  • Nope: Use of unresolved identifier – Chris G. Aug 30 '16 at 13:02
  • 1
    Check this @ChrisG. http://stackoverflow.com/questions/25113256/why-pch-file-not-available-in-swift – pedrouan Aug 30 '16 at 13:09
  • I did see that one. I guess it is time then :-) Thanks – Chris G. Aug 30 '16 at 13:14
  • ChrisG, it's not clear whether this is a duplicate of the question pedrouan links, or if you believe there is more to it? If it's a dupe, we can mark it such so that future searchers will be directed to the answer, but I don't want to do that if you have a deeper question. – Rob Napier Aug 30 '16 at 13:28
  • Hi @Rob Napier You are absolutely right, it became clear to me that the answer is what pedrouan linked to. Thanks for asking! I can also just delete the question? – Chris G. Aug 30 '16 at 13:33

0 Answers0