0

Recently all started using swift with my objective-c project. I used below post to make my objective-c files available in my swift files: https://stackoverflow.com/a/24005242/1939409

but it seems that for any class that I want to be available in swift files I should import it in my Bridging-Header. Is there any shorter and simple way to make all of my objective-c files available in the swift files too? I have hundreds files and from now I want to code my project with swift. I want to be able to use my old codes and also proceed with swift. It do not seems good to import all of them in the Bridging-Header.

Community
  • 1
  • 1
Husein Behboudi Rad
  • 5,434
  • 11
  • 57
  • 115

1 Answers1

1

If you have hundreds of existing headers that you potentially want to make available from Objective-C to Swift, you may want to look at dividing your project into multiple targets: all public headers in a framework will naturally be available to a Swift based dependent target as well. Of course you'll need to put together an umbrella header in that case that will list all public headers of that framework, but clearly declaring a public interface tends to be a worthwhile effort anyway for a project whose source code files range in the hundreds of source code files / headers.

mz2
  • 4,672
  • 1
  • 27
  • 47