Add basic Xamarin.iOS support

This commit is contained in:
Rui Marinho
2016-12-08 19:09:02 +00:00
parent 25b206ac53
commit 00e862173c
20 changed files with 812 additions and 9 deletions

View File

@@ -14,18 +14,21 @@ namespace Facebook.Yoga
{
internal static class YogaLogger
{
#if !__IOS__
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void Func(YogaLogLevel level, string message);
#endif
private static bool _initialized;
#if !__IOS__
private static Func _managedLogger = null;
public static Func Logger = null;
#endif
public static void Initialize()
{
if (!_initialized)
{
#if !__IOS__
_managedLogger = (level, message) => {
if (Logger != null)
{
@@ -38,6 +41,7 @@ namespace Facebook.Yoga
}
};
Native.YGInteropSetLogger(_managedLogger);
#endif
_initialized = true;
}
}