2

I'm working on a React Native app and I'm trying to use a module called react-native-socketio.

In order to proceed with the app, I will need to bridge the objective C header in Xcode but the related section is missing.

According to the tutorial According to the tutorial

Xcode

I have also noticed that the section Swift Compiler – Code Generation is also missing from Xcode.

Why?

J.Doe
  • 1,097
  • 1
  • 16
  • 34

2 Answers2

10

I have resolved this matter by first adding a new swift file to the project, then the respective section appeared.

As you can probably tell, I now have an empty Swift file just sitting inside my project folder and options to bridge my header file.

enter image description here

Thanks for the help everyone.

J.Doe
  • 1,097
  • 1
  • 16
  • 34
1

Looks like you have created an ObjectiveC project instead of Swift (I can see the AppDelegate.h & AppDelegate.m). ObjC project wont have Swift Compiler section. Select Swift as language while creating project

Anil Varghese
  • 42,757
  • 9
  • 93
  • 110
  • I am working on a React Native project, it automatically create the entire Xcode file for me, which is in Objective C. – J.Doe Jun 28 '16 at 09:25
  • there should be way to choose the language. If you try to create a new project in Xcode you can choose Swift/ObjectiveC – Anil Varghese Jun 28 '16 at 09:27
  • There's no problem mixing ObjC and swift in the same app. – Jean Regisser Jun 28 '16 at 09:30
  • Yes you can use ObjC files in Swift project. can you do vice versa? @JeanRegisser – Anil Varghese Jun 28 '16 at 09:33
  • @JeanRegisser Thanks, I wasnt aware about that. I always choose language as `Swift` and add ObjC files, never tried vice versa. looks like when we add the first swift file to the project will get swift related settings and there is no difference if you choose swift/ObjC while creating the project :) – Anil Varghese Jun 28 '16 at 10:16