0

I am working on a project which was developed in Objective C till today, and from now all new files to be developed in Swift3. I am giving you a small scenario here... ViewController, TableViewController and respective custom table view cells are in objective c till now, from now for any new table view cells to be developed we need to use swift and xib, can some one tell me the way or some urls that helps me.

SRK
  • 1
  • 4
  • Create a new file and select "Swift" as the language. What is the problem? – Martin R Dec 29 '16 at 17:20
  • @Martin, Yes I created. How to I access Swift TableViewCell in my Objective C TableViewController, Please suggest. – SRK Dec 29 '16 at 17:22
  • 1
    Have a look at http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift, it explains how to call Objective-C from Swift and vice versa. – Martin R Dec 29 '16 at 17:26

1 Answers1

0

UPDATE, check here please: Can't use Swift classes inside Objective-C

So in this case, you need to wrap your swift code into an embedded framework and import it in objective C project. Once you setup sub project structure, you can apply changes in Swift code and apply it in your project just easily. Please refer below screenshot of the structure:

Structure - Using swift in Objective C project

After importing the framework, you can import the swift code using #import <FrameworkName/SwiftFileName-Swift.h>

Community
  • 1
  • 1
christian
  • 445
  • 1
  • 3
  • 12