-1

i install Podfile in my app, and run it from my file .xcworkspace. My project is a Swift project but the pod installed are in ObjectC. I create myApp-Bridging-Header.h and add in it:

#import "SignalR.h"
#import "RockSocket.h" 
...

then open target>BuildSetting and add the path for the bridgingFile in SwiftCompiler-CodeGeneration>Object-C BridgingHeader. I build the project and it's work fine, but in my ViewConytoller file when i create:

var connection:SignalR = SignalR()

i have the error "use undeclared type 'SignalR'.

I read some question but i don't solve my problem. Please can you help me??

EDIT I can't use SwiftR because it's write in JavaScript code and Jquery library, and i can't use it This is the screenshot of my bridging file. enter image description here

and this is my pod file:

platform :ios, '9.0'
pod 'AFNetworking', '2.6.3'
pod 'SocketRocket', '0.3.1-beta2'
pod 'SignalR-ObjC', '2.0.0.beta1'

Hope you can help me. Thanks fir your answers.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
pampua84
  • 696
  • 10
  • 33

2 Answers2

0

In bridging header file you can write something like :-

#import "fileName.h"
or
#import "<filename/fileName.h>"
  • Sorry, i made a mistake, i used: #import "SignalR.h" and try also: #import but it doesn't work – pampua84 Feb 12 '16 at 13:48
  • Go to swift compiler-code generation and check your bridging header file...and also take sacreen shot of your xcode where your bridging header file is showing and upload here...so i will get your actual problem – pradeepchauhan_pc Feb 13 '16 at 05:58
0

There is a swift wrapper provided for SignalR-ObjC called SwiftR, so you will have to do the follwing in your Pod file

use_frameworks!
pod 'SwiftR'

checkout the link here https://github.com/adamhartford/SwiftR

Sumeet
  • 1,055
  • 8
  • 18