Blaž Vantur
10/23/2024, 11:59 AMBlaž Vantur
10/23/2024, 12:00 PMclass InspektifyAppDelegate: NSObject(), UIApplicationDelegateProtocol {
}
Usage of it in swift code
`iOSApp.swift`:
import SwiftUI
import ComposeApp
@main
struct iOSApp: App {
@UIApplicationDelegateAdaptor(InspektifyAppDelegate.self) var appDelegate
init() {
KoinImplKt.doInitKoin()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Error that I am getting when trying to run iOS app:
error: generic struct 'UIApplicationDelegateAdaptor' requires that 'InspektifyAppDelegate' conform to 'UIApplicationDelegate'
@UIApplicationDelegateAdaptor(InspektifyAppDelegate.self) var appDelegate
^
SwiftUI.UIApplicationDelegateAdaptor:4:43: note: where 'DelegateType' = 'InspektifyAppDelegate'
@MainActor @propertyWrapper public struct UIApplicationDelegateAdaptor<DelegateType> : DynamicProperty where DelegateType : NSObject, DelegateType : UIApplicationDelegate {
François
10/23/2024, 12:45 PM*__attribute__*((unavailable("Kotlin subclass of Objective-C class can't be imported")))
*__attribute__*((swift_name("InspektifyAppDelegate")))
*@interface* SharedInspektifyAppDelegate : NSObject
@end
François
10/23/2024, 12:45 PMBlaž Vantur
10/23/2024, 12:47 PMFrançois
10/23/2024, 12:48 PM