vtourraine / VTAcknowledgementsViewController

Acknowledgements screen displaying a list of licenses, for example from CocoaPods dependencies.
MIT License
856 stars 65 forks source link

Why 2 libraries (Objective-C/Swift)? #71

Open iDevelopper opened 3 years ago

iDevelopper commented 3 years ago

Not an issue.

Are there any particular reasons for maintaining the two repos?

https://github.com/vtourraine/VTAcknowledgementsViewController

https://github.com/vtourraine/AcknowList

vtourraine commented 3 years ago

Historical reasons, I guess? šŸ˜…

The library started as ObjC. Then I tried to re-implement it in Swift when it was introduced. Both projects are still being used, therefore both are still being maintained. Some people want ObjC only, others Swift only, and there are good reasons for both.

The sane thing would be to retire one of them, and just maintain one. Iā€™ll probably do that at one point.

PS: Iā€™m thinking about adding a SwiftUI implementation now. Maybe just as an ā€œadd onā€ to the Swift version, but thatā€™s a different discussion anyway...

iDevelopper commented 3 years ago

First, I think we could expose the swift framework to Objective-C. What about this?

vtourraine commented 3 years ago

Using @objc annotations? That seems like a good idea (I just hope weā€™re not overlooking some kind of obscure feature or optimization only available in Swift-only libraries). Feel free to open a pull request on AcknowList (or at least an Issue to call this out).

iDevelopper commented 3 years ago

I don't understand why but it already works without using @objC annotations!

AcknowListTestObjC.zip

AcknowListTestObjCSPM.zip

vtourraine commented 3 years ago

Interesting. Maybe because theyā€˜re subclasses of Objective-C classes, so thereā€™s some inherited compatibility?

But still, only the [[class alloc] init] initializer is available. And objects like Acknow and the parser are not available at all. So thereā€™s still work to be done to have AcknowList really Objective-C compatible.

iDevelopper commented 3 years ago

Exact, you are right! Ouf, because I did not understand! Not all functions need to be compatible? Do you need the parser to be public? Or internal?

vtourraine commented 3 years ago

Everything that is open/public in Swift should also be accessible from Objective-C, if we want it to be fully compatible.

iDevelopper commented 3 years ago

I don't think so. We need to expose only the functions that a user will use in an Objective-C project.

vtourraine commented 3 years ago

I understand your point of view, but some developers will want to have access to everything that is already accessible in Swift, especially if we want to retire the Objective-C library later on.