I need to make an library for iOS (either Framework or static library - I haven't decided yet) that can be used in both Objective-C and Swift projects. What is the best way of doing this? The way I see it I have three options:
- Write the library in Objective-C and add support for Swift (bridging headers etc).
- Write the library in Swift and add support for Objective-C.
- Write two libraries, both in Objective-C and Swift. I really want to avoid this option.
The main requirement here is that it should be as easy for developers to use as possible. Ideally, they should be able to choose their language and not care, or indeed even know, what language the library itself was written in. Can this be done?
Also, I want to be able to distribute the library with CocoaPods, if this has any significance.