Skip to content

[YogaKit] Improved the objective-c and swift api#322

Closed
hartbit wants to merge 2 commits into
react:masterfrom
hartbit:improve-yogakit-api
Closed

[YogaKit] Improved the objective-c and swift api#322
hartbit wants to merge 2 commits into
react:masterfrom
hartbit:improve-yogakit-api

Conversation

@hartbit

@hartbit hartbit commented Jan 5, 2017

Copy link
Copy Markdown
Contributor

Compared to what was planned, I added the overflow value which seemed missing. I had to modify the implementation a bit for all values which are backed by a YGValue, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.

@emilsjolander emilsjolander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments. Mostly this looks very good and I'm pretty confident we can merge this later today. Thanks!

Comment thread YogaKit/YGLayout.m Outdated

@interface YGLayout ()

@property (nonatomic, weak, readonly) UIView* view;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UIView *view

Comment thread yoga/YGEnums.h Outdated
YG_EXTERN_C_BEGIN

#define YGFlexDirectionCount 4
#ifndef NS_ENUM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this generate something short (less duplicated) ? Maybe by creating our own YG_ENUM macro which expands to one of the two alternatives.

Comment thread YogaKit/YGLayout.m Outdated
#import <yoga/Yoga.h>
#import <UIKit/UIKit.h>

extern YGValue YGValueMake(CGFloat value, YGUnit unit) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems unused. Could you remove it?

Comment thread YogaKit/YGLayout.h Outdated

#import <UIKit/UIKit.h>
#import <yoga/YGEnums.h>
#import <yoga/YGValue.h>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import seems unused, could you remove it?

Comment thread yoga/YGValue.h Outdated
@@ -0,0 +1,19 @@
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulling this out into a separate file seems to not be needed for this PR. Could you revert this change?

@hartbit

hartbit commented Jan 6, 2017

Copy link
Copy Markdown
Contributor Author

I implemented all your suggestions 😄 Thanks 👍

Comment thread YogaKit/UIView+Yoga.h
Mark that a view's layout needs to be recalculated. Only works for leaf views.
*/
- (void)yg_markDirty;
@property (nonatomic, readonly, retain) YGLayout *yoga;

@d16r d16r Jan 6, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change this to strong

http://nshipster.com/associated-objects/

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@emilsjolander has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Comment thread YogaKit/YGLayout.m

- (instancetype)initWithView:(UIView*)view
{
if ([super init]) {

@d16r d16r Jan 6, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, we should be assigning this to self, i.e.

self = [super init]

I know this isn't technically required, but I think it's good to keep the standard. More about that here: https://www.cocoawithlove.com/2009/04/what-does-it-mean-when-you-assign-super.html

@emilsjolander

Copy link
Copy Markdown
Contributor

@hartbit Don't worry about it. I'll fix this while mergin

@d16r

d16r commented Jan 6, 2017

Copy link
Copy Markdown
Contributor

Awesome job @hartbit!! I'm so excited to land this!

splhack added a commit to splhack/css-layout that referenced this pull request Jan 7, 2017
Align C# implementation with YogaKit react#322
This was referenced Jan 7, 2017
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Jan 7, 2017
Summary:
Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.
Closes react/yoga#322

Reviewed By: dshahidehpour

Differential Revision: D4386906

Pulled By: emilsjolander

fbshipit-source-id: 05ac0e571ef3a8ff0be31469e449a7b23f102218
@hartbit hartbit deleted the improve-yogakit-api branch January 7, 2017 16:31
facebook-github-bot pushed a commit that referenced this pull request Jan 8, 2017
Summary:
Align C# implementation with YogaKit #322
Closes #327

Reviewed By: emilsjolander

Differential Revision: D4390687

Pulled By: splhack

fbshipit-source-id: 28c87a45898fcd958a422d5e254ead0ec00d3562
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Jan 8, 2017
Summary:
Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.
Closes react/yoga#322

Reviewed By: cosmin1123

Differential Revision: D4391434

Pulled By: emilsjolander

fbshipit-source-id: e33f6f7b2bbaad29553100b7a5bb424496372110
facebook-github-bot pushed a commit that referenced this pull request Jan 8, 2017
Summary:
Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.
Closes #322

Reviewed By: cosmin1123

Differential Revision: D4391434

Pulled By: emilsjolander

fbshipit-source-id: e33f6f7b2bbaad29553100b7a5bb424496372110
@ericvicenti

Copy link
Copy Markdown

It looks like the import of this commit into react-native causes CI tests to fail. Can somebody help fix this ASAP?

https://travis-ci.org/facebook/react-native/builds/190054212

@emilsjolander

Copy link
Copy Markdown
Contributor

@ericvicenti looking now

@emilsjolander

Copy link
Copy Markdown
Contributor

@ericvicenti Found issue. Pushing fix within next few hours

@hartbit

hartbit commented Jan 9, 2017

Copy link
Copy Markdown
Contributor Author

@emilsjolander What was the problem?

@emilsjolander

Copy link
Copy Markdown
Contributor

0acb620

@hartbit

hartbit commented Jan 9, 2017

Copy link
Copy Markdown
Contributor Author

Ah, of course!

@guidomb guidomb mentioned this pull request Jan 26, 2017
8 tasks
vincentriemer pushed a commit to vincentriemer/yoga-dom that referenced this pull request May 9, 2018
Summary:
Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.
Closes react/yoga#322

Reviewed By: dshahidehpour

Differential Revision: D4386906

Pulled By: emilsjolander

fbshipit-source-id: 05ac0e571ef3a8ff0be31469e449a7b23f102218
vincentriemer pushed a commit to vincentriemer/yoga-dom that referenced this pull request May 9, 2018
Summary:
Compared to what was planned, I added the `overflow` value which seemed missing. I had to modify the implementation a bit for all values which are backed by a `YGValue`, but we should probably enable the pixel dimensions in Objective-C and Swift somehow later.
Closes react/yoga#322

Reviewed By: cosmin1123

Differential Revision: D4391434

Pulled By: emilsjolander

fbshipit-source-id: e33f6f7b2bbaad29553100b7a5bb424496372110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants