You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
One of the techniques to consume third party SDKs in swift from kotlin, consist of:
1- Declare an interface in the kotlin side,
2- Then create a class in swift which conforms to the respective interface(protocol in swift). This class does the actual interaction with the third party SDK.
3- Then we provide these implementations to the koin container bridging the interface implementations typically using a helper class for this.
Describe the solution you'd like
I would like to be able to replace the above boilerplate by introducing an annotation that automatically generates, in a specific module, a factory that will bind my swift implementation to my kotlin interface definition. Sort of bellow setup
Describe alternatives you've considered
The repetitive steps in the above problem description.
Target Koin project
koin-annotation
The text was updated successfully, but these errors were encountered:
pablichjenkov
changed the title
Make it possible to use koin-annotation in swift code.
Make it possible the equivalent of koin-annotation in swift code. Leveraging custom swift attributes.
Sep 18, 2024
pablichjenkov
changed the title
Make it possible the equivalent of koin-annotation in swift code. Leveraging custom swift attributes.
Make the equivalent of koin-annotation in swift code. Leveraging custom swift attributes.
Sep 18, 2024
Is your feature request related to a problem? Please describe.
One of the techniques to consume third party SDKs in swift from kotlin, consist of:
1- Declare an interface in the kotlin side,
2- Then create a class in swift which conforms to the respective interface(protocol in swift). This class does the actual interaction with the third party SDK.
3- Then we provide these implementations to the koin container bridging the interface implementations typically using a helper class for this.
Another alternative is using global functions that serves as a factory but it kind of pollute the global scope and requires some boilerplate initializing them too.
For reference to the problem you can check this question in stackoverflow:
https://stackoverflow.com/questions/77541454/call-swift-code-from-kotlin-multiplatform
Describe the solution you'd like
I would like to be able to replace the above boilerplate by introducing an annotation that automatically generates, in a specific module, a factory that will bind my swift implementation to my kotlin interface definition. Sort of bellow setup
Where "KoinBean" refers to the annotation I am proposing. Which in swift I believe the equivalent is called attributes. This is docs: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes/
Describe alternatives you've considered
The repetitive steps in the above problem description.
Target Koin project
koin-annotation
The text was updated successfully, but these errors were encountered: