2

I have installed an obj-c framework in my swift project using cocoapods. In my bridging header file I have imported the framework which works fine.

#import "libPhoneNumber_iOS/NBPhoneNumberUtil.h"
#import "libPhoneNumber_iOS/NBPhoneNumber.h"

However I can't seem to use the classes in my project

let phoneUtil = NBPhoneNumberUtil()

This gives an error that I am using an unresolved identifier.

In my podfile I have use_frameworks!, but I can't import the classes directly in a swift class. In my build settings also I have already set the configuration to use the pod-config file.

The framework works fine if I add it manually to my project (not using cocoapods) and import in my bridging header.

Is this problem a problem with cocoapods or am I doing something wrong? Can't seem to find a way for this to work. Any help would be appreciated. Thanks!

  • 2
    try add "import libPhoneNumber_iOS" to your swift file. – wj2061 Nov 02 '15 at 08:52
  • Check out this answer, I think it may help you: http://stackoverflow.com/a/33436152/5075515 – Bart Nov 02 '15 at 08:52
  • 1
    try using the framework header syntax: `` and also make sure to import the framework in your swift class: `import libPhoneNumber_iOS` – Daniel Galasko Nov 02 '15 at 09:06
  • importing the module to my swift class works. I was trying to import the class earlier which didn't work but adding the module works fine. Thanks! – shubhamrawal7 Nov 02 '15 at 09:20

0 Answers0