YogaKit macOS support? #589
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
How about support macOS?
It's not on our roadmap at the moment, but I'd love a PR!
I spent some time getting a macOS version working here: https://github.com/joemcbride/YogaKit
The sample project currently targets Xcode 8.2.1 since the project I plan on using it with is stuck on that at the moment.
I'm not familiar with what the typical pattern would be to create a multi-targeted library, though I would be willing to make an attempt if someone can point me in the right direction. I'm mostly unsure if we could re-design some of the classes (looking at you
YGLayout
) that depend onUIView
/NSView
or if it would be mostly duplicate code. There are a few differences between the two but it was mostly just renamingUIView
toNSView
inYGLayout
. This could easily be done by introducing a protocol though I don't think that would be the best fit.macOS also does not have
sizeThatfits
so I'm not 100% sure of the implications of that yet, though initial basic scenarios seem to be behaving as expected.This may or may not be a bit moot with Apple's announcement of running iOS in macOS (bye AppKit??), though I wanted to start using this now.
This could be implemented as:
@alexdrone Thanks! I'm still learning cocoa so that is super helpful.
my PR https://github.com/facebook/yoga/pull/913
We are deprecating YogaKit as part of the Yoga 2.0 release. We are still going to release a new revision based on the current state of the repo, but won't be accepting new contributions, since we are going to be removing it from the repo after.