0

I have the following two methods in an custom objective c framework

- (void) callWithProfile:(UserProfile *) user number:(NSString *) number name:(NSString *)name instructions:(NSString *)instructions
{
    //
}

// Make call connection
- (void) startConnecting
{
   //
}

and I can call startConnecting with

 let socket : SocketSingleton = SocketSingleton()
       socket.startConnecting()

but it won't let me call callWithProfile. Both methods are declared in the header file and there are no errors in the framework. How can I call the other method from my swift project?

Kevin Stewart
  • 415
  • 6
  • 16
user1079052
  • 3,803
  • 4
  • 30
  • 55
  • Have you added bridging header ? – Pushkraj Lanjekar Jun 03 '16 at 18:08
  • yes I it has been added – user1079052 Jun 03 '16 at 18:23
  • Did you declare the method in your header file? – diatrevolo Jun 03 '16 at 18:37
  • Can you please try with var instead of let once ? I think this will be stupid suggestion but working for me in one case. – Pushkraj Lanjekar Jun 03 '16 at 18:42
  • Yes it is declared in my header. – user1079052 Jun 03 '16 at 18:43
  • Refer this : http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift – Pushkraj Lanjekar Jun 03 '16 at 18:45
  • I tried with var and no go. At first I thought it had something to do with the methods but out of these 3 methods, I can access handleDisconnect but not the first and last so it has nothing to do with the method structure - (void) callWithProfile:(UserProfile *) user number:(NSString *) number name:(NSString *)name instructions:(NSString *)instructions; - (void) handleDisconnect:(bool)stayConnected netDown:(int)netDown; - (void) declineInboundCallWithProfile:(UserProfile *) profile andNumber:(NSString *) number andName:(NSString *)name; – user1079052 Jun 03 '16 at 19:08
  • Pushkraj I have read through that but it doesn't give the answer. My bridging header connecting is working since I can call some methods from my framework and they are in the same controller. – user1079052 Jun 03 '16 at 19:22

0 Answers0