Maybe NSClassFromString("XamarinAssociatedObject")
?
Write a Swift library binding to detect Xamarin
CodeMan
1
Reputation point
I'm building a native SDK in Swift and I would like to be able to detect at runtime if the app is in Xamarin. My first thought was to use some reflection to determine if Xamarin classes are present by doing something like this:
if NSClassFromString("xamarin-support") != nil
But I don't think that'll actually return true in a Xamarin app since xamarin-support is a file not a class: https://github.com/xamarin/xamarin-macios/blob/main/runtime/xamarin-support.m
Are there any ways I could write some Swift that would detect if the current app is built using Xamarin? Any pre-processors?
1 answer
Sort by: Most helpful
-
CodeMan 1 Reputation point
2021-10-05T16:34:58.25+00:00