I am working on a library for iOS, and i need to know if the application using the library is running SwiftUI or not so that i can handle things appropriately.
Is there a way to find this out programmatically in Objective-C?
I am working on a library for iOS, and i need to know if the application using the library is running SwiftUI or not so that i can handle things appropriately.
Is there a way to find this out programmatically in Objective-C?
In the end i did this.
Get the root or key window of the application.
Check if it's class name contains "UIHostingController"
Also nil check for this: NSClassFromString(@"SwiftUI._UIGraphicsView")
You could also check for other swift ui classes but this has covered all cases so far.