1

I am trying to add SocketClusteriOS (https://github.com/abpopov/SocketCluster-ios-client) pod written in Objective C to Swift project. I've tested the this pod in Objective C project, url seems working fine, but when I am trying to add it to Swift project I have strange errors:

NewSocketTestApp[1641:29629] {"event":"#disconnect","data":
{"code":4005}}
#disconnect

I might think the problem in bridging header. I attached the link to my repository of test app. https://github.com/davigr/SocketClusterSwift. SocketCluster-ios-client uses SocketRocket pod, I mentioned this pod in my bridging header as well. Unfortunately, when I am trying connect it couldn't. I did the same code in Objective C project, everything was fine. Could anyone help me to fix this issue? Maybe problem in Project settings or bridging headers My bridging header:

#ifndef Bridging_Header_h
#define Bridging_Header_h
#import "Pods/SocketCluster-ios-client/Pod/Classes/SCChannel.h"
#import "Pods/SocketCluster-ios-client/Pod/Classes/SCSocket.h"
#import "Pods/SocketCluster-ios-client/Pod/Classes/SCMessage.h"
#import "Pods/SocketRocket/SocketRocket/SocketRocket.h"
#import <Foundation/Foundation.h>
#import <CFNetwork/CFNetwork.h>
#import <Security/Security.h>
  • Make sure your bridging header name is same in the Build Settings -> Swift Compile -> Next to “Objective-C Bridging Header” !! – Anurag Sharma Jun 03 '17 at 03:46
  • It's the same, I've checked. The bridging header seems working fine, because I can import the frameworks in a class, and create the instance of the socket. The problem with the connectivity. Somehow my socket doesn't want connect to the server. I did the same procedure in Objective C test project like that one https://github.com/davigr/SocketClusterSwift in swift. I think the only way to help me with issue is to download my test swift project (link above). Otherwise, it's too difficult to explain the problem. –  Jun 03 '17 at 10:06

1 Answers1

0

Solved, the link with socket cluster will be soon