Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iDevelopper opened this issue Feb 2, 2021 · 9 comments
Open

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

iDevelopper opened this issue Feb 2, 2021 · 9 comments
Labels

Comments

@iDevelopper
Copy link

Not an issue.

Are there any particular reasons for maintaining the two repos?

https://github.com/vtourraine/VTAcknowledgementsViewController

https://github.com/vtourraine/AcknowList

@vtourraine
Copy link
Owner

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...

@vtourraine vtourraine changed the title Question Why 2 libraries (Objective-C/Swift)? Feb 2, 2021
@iDevelopper
Copy link
Author

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

@vtourraine
Copy link
Owner

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
Copy link
Author

iDevelopper commented Feb 3, 2021

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

AcknowListTestObjC.zip

AcknowListTestObjCSPM.zip

@vtourraine
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@iDevelopper
Copy link
Author

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

@vtourraine
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants