Search code examples
objective-cswiftxcodellvm-clang

Location of the generated header "MyProject-Swift.h"


I am working on a project with mixed Objective-C and Swift; I followed the "Using Swift with Cocoa and Objective-C" guide by Apple and it works great.

Out of curiosity, I would like to locate and read the generated header described in the "Mix and Match" chapter :

Objective-C and Swift Mix and Match

But I can not find it anywhere in Xcode


Solution

  • Finding the editing file

    If you want to find the header file in your project, press..

    cmd + shift + 0
    

    when the search bar pops up, search for your file name

    MyProject-swift.h
    

    on the file press

    cmd + shift + j
    

    then right click and tap reveal in finder

    Finding the generated file

    1) Go to any objective c class where you import Myproject-swift.h

    2) Then press cmd on "#import Myproject-swift.h" on top of the file

    3) Click "jump to definition"

    3) And there it is!

    Let me know if that solves your problem!