0

I'm trying to use libPhoneNumber-iOS/NBPhoneNumber in a swift project and I'm getting a file not found error in the bridging header

#import <libPhoneNumber-iOS/NBPhoneNumber.h>

Pod file

pod 'libPhoneNumber-iOS', '~> 0.7'

https://github.com/iziz/libPhoneNumber-iOS

What should I be referencing to get it to find the pod? libPhoneNumber-iOS

MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460

2 Answers2

6

I figured out the problem: the "-" in the path gets replaced with an underscore automatically by cocoapods. Thus it should be

#import <libPhoneNumber_iOS/NBPhoneNumber.h>

MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
0

If you don't have bridging file then create at below

go file -> new -> iOS-> Source -> objective - C file and given name as project name

then after create 2 file one .m file and second .h file delete .m file

open yourprojname-bridging-header.h in write #import

more reference use this link How to call Objective-C code from Swift

Community
  • 1
  • 1
Memon Irshad
  • 972
  • 1
  • 8
  • 17
  • already have the bridging file and did as the instructions say - but the line `#import ` in the bridging file shows the error – MonkeyBonkey May 25 '15 at 11:55
  • can you set path of bridging header file in bulid settings – Memon Irshad May 25 '15 at 12:27
  • the bridgin header file is already set up - no problem with the bridging file itself. there is a problem with the import statement. the error is noted in the question above - file not found error – MonkeyBonkey May 26 '15 at 10:43