I created an objective-C project for socket programming and its working fine now i want to import it into my Swift project where i am using JSQmessageViewController for chating. I copied "AsyncSocket.h" and "AsyncSocket.m" into my swift proejct and imported them in bridging header as well but when i try to use them in my "ViewController.swift" it gives me error
My bridging Header is working fine because i can use JSQmessageViewController in my "ViewController.swift" without any issues. This is my bridging header
Build Settings seems fine to me
But still getting this error
No. You don't import your Objective-C file directly to your swift file. Write something like
let asyncSocketInstance:AsyncSocket = AsyncSocket()
. Make sure AsyncSocket appears under Compile Sources of Build Phases and its header file is imported in the bridging header file.