Abdul Basit
04/13/2024, 3:45 PMinterface AuthInterface {
fun signIn(): String
}
implementing that interface in iOS app in iOS module
class AWSCognito: AuthInterface{
func signIn() -> String {
return "Success"
}
}
Create the class in App and passing as an interface
@main
struct iOSApp: App {
var awsCognito = AWSCognito()
var body: some Scene {
WindowGroup {
ContentView(auth: awsCognito as AuthInterface)
}
}
}
Is this the correct approach or is there any other alternative?
I was also wondering about DI
, is it possible in KOIN ?Max
04/14/2024, 7:23 PMmodule {
single <interface> (passedRealIOSImpl)
}
I can send some code tomorrow. Or you can just follow normal koin KMP tutorial on the official website.Colton Idle
04/14/2024, 8:00 PMMax
04/14/2024, 8:52 PMAbdul Basit
04/15/2024, 4:19 AM