Here is my iOSApp swift class
import SwiftUI
import sharedKit
// no changes in your AppDelegate class
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
AppHelperModuleKt.doInitKoin()
print(">> AppHelperModuleKt.doInitKoin() called")
return true
}
}
@main
struct iOSApp: App {
// inject into SwiftUI life-cycle via adaptor !!!
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
✅ 1
m
mvand
03/27/2025, 4:50 PM
Use startKoin ^^
m
Michael Sainthonore
03/27/2025, 4:53 PM
I did
Copy code
fun initKoin(appDeclaration: KoinAppDeclaration = {}) {
Logger.d { "initKoin()" }
startKoin {
appDeclaration()
platformModule() + AppHelperModule.getSharedModules()
}
}
// For iOS only
fun initKoin() = initKoin {}
Michael Sainthonore
03/27/2025, 5:06 PM
I found my mistake, it was a bad setup in startKoin block
👍 1
Michael Sainthonore
03/27/2025, 5:07 PM
Sorry i bothered you i guess but thank you still 😄