Skip to content
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

Yoga Swift interface #620

Open
1 task done
lucdion opened this issue Aug 30, 2017 · 4 comments
Open
1 task done

Yoga Swift interface #620

lucdion opened this issue Aug 30, 2017 · 4 comments

Comments

@lucdion
Copy link
Contributor

lucdion commented Aug 30, 2017

Report

Issues and Steps to Reproduce

This is not an issue, but more a proposition.

YogaKit should have an official Swift interface, and not just a Objective-C interface. Swift has been around for more than 3 years now, and it is now the defacto iOS languages for new applications.

I've developed a nice Swift Yoga interface (at least from my point of view :-)) that gently wraps the Yoga flexbox implementation. I would be really happy to share it and integrate it with the Yoga's repo. You can find my project at https://github.com/lucdion/FlexLayout

Regards

Link to Code

https://github.com/lucdion/FlexLayout

@alickbass
Copy link

Any news here?

@lucdion
Copy link
Contributor Author

lucdion commented Jan 12, 2018

No @alickbass, but in the meantime, you can use it: https://github.com/layoutBox/FlexLayout

@NickGerleman
Copy link
Contributor

At this point FlexLayout has grown to be its own mature project. I think it is more likely that we should point to it in Yoga documentation instead of bringing into the repo.

@iainsmith
Copy link

Hey all, I started prototyping out an implementation in a standalone package at iainsmith/YogaSwift that uses Swift Macros to minimise the boilerplate code for wrapping the calls to YGNodeStyleGetXXX.

The next thing I am looking at is updating the gentest script to generate the swift tests.

If there’s interest in upstreaming some of this work into the main yoga Swift package, down the line, I’d be happy to move this to a new module in my yoga fork and PR it up.


The upcoming release of swift 6 has support for noncopyable generics & type (~Copyable) which facilitate building a more ergonomic Swift API, so users don’t have to manually call YGNodeFree, which is what my current implementation is targetting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants