Determine which swift version is available (if so) from framework

Hi all :-)

Very specific question today : I work for a company that produces an objC framework to many many clients and we want to know if we can update our framework to swift. To do so, we want to know if the framework is incorporated to pure objC projects or swift ones (depending on the version)

I tried to search, but I can't find any clue on how to check this. If I incorporate a Swift file to our framework, objC only clients will see their compilation fail. I looked for .swiftinterface file w/o any luck too.

Is there any way (even indirect with some preproc conditions and scripts) that can allow me to retrieve if our framework is used with a Swift project (or not) and if yes, which version of swift is used by our clients.

Thanks for your help!

No idea about the Objective-C part, but for checking swift versions you can have this kind of conditional code:

This is for the swift compiler version used (better for detecting the Xcode version used to compile):

#if compiler(>=5.1)
// do something
#endif

This is for the actual swift language version used:

#if swift(>=5.1)
// do something
#endif
Determine which swift version is available (if so) from framework
 
 
Q