1

I'm facing issue in adding ObjectC files to my swift project. I have added the .h and .m files, created the bridging objc header file with name <#projectname#>-Bridging-Header.h. My .m file is also visible in the build face compile source. But when i try to access my objc class in swift methods. I get this compiler error Use of unresolved identifier 'xxxxx' Any help is deeply appreciated.

Anil Varghese
  • 42,757
  • 9
  • 93
  • 110
skyler
  • 742
  • 1
  • 10
  • 24
  • Hey Buddy Just Follow this url....[Swift And Objective-c][1] [1]: http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift – Parvendra Singh Jun 13 '14 at 10:20

1 Answers1

3

I forgot to add the objc bridging header to the swift compiler in the build settings. This solved me the problem.

skyler
  • 742
  • 1
  • 10
  • 24
  • how do you add the bridging header? – Wojtek Turowicz Jun 27 '14 at 12:16
  • 1
    @Turowicz The bridging header is a regular header that you specify as a "Objective-C Briding Header" in the Swift compiler settings. For more details, see https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html – emidander Nov 20 '14 at 15:12