BonnierNews / react-native-3d-model-view

A React Native view for displaying 3D models
MIT License
215 stars 57 forks source link

How to add swift #14

Closed juliuscalvium closed 5 years ago

juliuscalvium commented 5 years ago

I can not get this running in react native. I have installed react-native-3d-model-view and the dependencies you mention. But it won't run when I try react-native run-ios You mention :

The ARModelView is written in Swift. So you need to add Swift to your project:

How do I do this?

birger-fuehne commented 5 years ago

In xcode, switch to the project navigator, and move to the App folder (where your AppDelegate.h and .m files are). Select "File" -> "New " -> "File" and choose Swift file. Name it Empty.swift. This should bring up a popup asking whether to create a bridge header file. Confirm.

Now you can change the Swift version in you build settings if necessary.

juliuscalvium commented 5 years ago

Thank you for you reply. I have done what you've said and now I have the option to change the Swift Compiler language version... It's set to 3.2. What should I set it to?

birger-fuehne commented 5 years ago

4.2 seems to work.

juliuscalvium commented 5 years ago

Hi again. The only options for me are 3.2 or 4.0. I am on Xcode 9.2. When I try to set it to 4.0 and run react-native run-ios it fails. I cannot update Xcode at the point for other reasons. Any suggestions?

screen shot 2018-11-09 at 10 17 22
juliuscalvium commented 5 years ago

The build failed error message seems to be talking about bundle identifiers.. but the build worked before I installed react-native-3d-model-view and linked it. Why would that be the case?

screen shot 2018-11-09 at 10 19 50
dlindstrm commented 5 years ago

@juliuscalvium try upgrading Xcode to 10 and use Swift 4.2.

johankasperi commented 5 years ago

If you want to use older version of Swift than 4.2 you can use release 1.1.17