Reputation: 1612
Is it possible to create a .dylib file from a Objective-C or Swift coded-project, or must the code be written in C++?
I've seen several sources, but they're all written in C++.
see - Creating and Using a Simple .dylib and How do I create a dynamic library (dylib) with Xcode?
Is it even possible to create a .dylib file using any other language than c++?
Upvotes: 3
Views: 3062
Reputation: 2229
As we discussed I have created an sample app for OS X. It uses dylib with single Foo Swift class. Foo has doSomething method, which logs kind of "hello world" message into the console.
Once you are built the project, you can find the dynamic library inside the application bundle in the Frameworks folder. It named libFoo.dylib.
Source code: https://github.com/melifaro-/OSXDylibSample
Hope it helps.
Upvotes: 3