Unable to import in CoreNFC in swift project Xcode

2019-09-16 04:25发布

问题:

I am unable to import CoreNFC in a swift project. Getting this error No such module CoreNFC.

I also added the framework to Linked Frameworks and Libraries.

回答1:

According to a post on the Apple Developer forums, you can only build for a real device or the Generic iOS device as there is no x86 version of CoreNFC.

Once you switch to one of these, you do not need to add CoreNFC to Linked Frameworks and Libraries, just @import it:

@import CoreNFC;