A third part company has provide me a Framework. I would like to check the swift version embedded in the framework (2.2, 2.3 or 3.x) The framework directory include libswift dylib files.
How to check the swift version used in the framework ?
Thanks !
A framework is a hierarchical directory that encapsulates a dynamic library, header files, and resources, such as storyboards, image files, and localized strings, into a single package. Apps using frameworks need to embed the framework in the app's bundle.
Swift is a multipurpose, multi-paradigm compiled language created by Apple Inc. It is used for macOS, iPadOS, iOS, watchOS, Linux, and tvOS. The team that developed it makes use of an open-source LLVM compiler framework.
Kitura. The concept for the App Development with Swift marks its success with these language web services and web framework development called Kitura. Apart from the swift framework, Kitura also uses an HTTP server, making it a faster and reliable way of working with web services.
I used the -Swift.h
Header file.
$ cat FrameworkName.framework/Headers/FrameworkName-Swift.h
First line is the information you need:
// Generated by Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
You can use otool
to print all versions of included binaries in the framework:
otool -l /path/to/your/FrameworkName.framework/Versions/A/FrameworkName
You can use Oskars answer to get the swiftlang version (in your case: 703.0.18).
Now you just have to lookup for the Swift version in the following table:
Swiftlang version Swift version
- -
swiftlang-602.0.49.3 1.2
swiftlang-602.0.49.6 1.2
swiftlang-602.0.53.1 1.2
swiftlang-700.0.59 2.0
swiftlang-700.1.101.6 2.1
swiftlang-700.1.101.15 2.1.1
swiftlang-703.0.18.1 2.2
swiftlang-703.0.18.8 2.2
swiftlang-800.0.46.2 3.0
swiftlang-800.0.58.6 3.0.1
swiftlang-800.0.63 3.0.2
swiftlang-802.0.48 3.1
swiftlang-802.0.51 3.1
swiftlang-802.0.53 3.1
Source: Wikipedia
So 703.0.18 means Swift version 2.2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With