0

I have a requirement where i had to integrate a swift class in my objective c coding. I am pretty new to this concept, but I was able to integrate swift file into objective c code with some online guiding.After integration, i need to set some values to swift class variables from objective C class which am not able to do so. I am not able access the variables that are declared in swift class.While integrating swift class, i didn't implement any init() or initwithframe in swift class. Can someone please guide me on how to access swift class variables from objective c class.

Kalyan
  • 263
  • 5
  • 22
  • once refer following link , i hope it will help you, http://stackoverflow.com/questions/24078043/call-swift-function-from-objective-c-class – Satyanarayana Aug 19 '16 at 13:53

1 Answers1

0

Right click on project and choose New File then please check the screen shots enter image description here

Then Would you like to configure an Objective-C bridging header? this will come then press on Create Bridging Header, now in bridging-Header.h you can import as #import "Viewcontroller.h"

In your Swift class use

 class filenew 
 {
     init()
   {

   }
 }
Reshmi Majumder
  • 961
  • 4
  • 15