-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chsarp] Add YogaKit Shared and iOS version #336
Conversation
…ne. Using shared code for reuse in other platforms. Adds YogaKit sample
I'm worried about this copying a lot of logic from YogaKit. Can Xamarin interop with the obj-c code in YogaKit instead? |
This is so we can share YogaKit implementation to other platforms like android and uwp. I could do binding for the the YogaKit lib ... but that will only work for iOS. |
Aren't you tying yourself to iOS by doing |
That file only lives in the YogaKit iOS project, it's a partial class , so the methods are only added when you are running in that platform. |
Ok, makes sense. Thanks for taking the time to explain 👍 I'll let @splhack give the final ok on the c# code but it looks good to me. |
I feel maybe we can have another approach for this. For example, this line from test.
It would be like next line if we can use
I'll try to hack around YogaKit based on this PR later. |
@splhack yeah maybe C# 7 or 8 will give us Extension Properties . But i agree with you and open to a solution :) |
Added tests |
@emilsjolander has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Using shared code for reuse in other platforms based on iOS native implementation.
Adds YogaKit sample.
Adds YogaKit tests (same as objc). (3 tests failing)
Since we don't have extension properties we need to go with a extension method to get access to the YogaLayout .
I m also not sure this is leak free yet, would love some help with testing and feedback about view/node lifecycle