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

Change Objective-C API to chained call #229

Merged
merged 9 commits into from
May 18, 2021
Merged

Conversation

protosse
Copy link
Contributor

I have always used PinLayout with Swift before, but lately i have to begin a project with Objective-C.
Too many brackets are really a nightmare.

Copy link
Member

@lucdion lucdion left a comment

Choose a reason for hiding this comment

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

Wow, really nice, I always wanted to support that, but never took the time to do it. Really nice job 👌👌👌

One tine comment + could you update the documentation (docs/objective_c.md)
Thanks

// [[[[segmented.pinObjc rightOf:logo aligned:VerticalAlignTop] rightWithInsets:safeArea] marginHorizontal:margin] layout];
// [[[[[[textLabel.pinObjc belowOf:segmented aligned:HorizontalAlignLeft] widthOf:segmented] pinEdges] marginTop:margin] sizeToFit:FitWidth] layout];
// [[[[[separatorView.pinObjc belowOfViews:@[logo, textLabel] aligned:HorizontalAlignLeft] rightTo:segmented.edge.right] height:1] marginTop:margin] layout];
logo.pinObjc
Copy link
Member

Choose a reason for hiding this comment

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

Could you put this on a single line, so that it matches Swift style?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK👌

@protosse
Copy link
Contributor Author

image
sorry i don't known why it build failed on macOS, it seems to be running well.

@ingod9true
Copy link

合并好了吗,大佬

@lucdion
Copy link
Member

lucdion commented May 17, 2021

@protosse, you need to fix the compilation of the objective-c unit tests (ObjectiveCSpec.m)

Copy link
Member

@lucdion lucdion left a comment

Choose a reason for hiding this comment

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

You just need to fix unit tests + this little doc change

@@ -47,6 +50,6 @@ When using the Objective-c interface, the `layout` method must be called explici
view.pin.width(100)

// Objective-c
[[view.pinObjc width:100] layout];
view.pinObjc.width().layout();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
view.pinObjc.width().layout();
view.pinObjc.width(100).layout();

@protosse
Copy link
Contributor Author

@lucdion hello, i have fixed all the compilation of the objective-c unit tests, except the code in the carthage directory, it will use the PinLayout from github, so can i comment them?
image

@lucdion
Copy link
Member

lucdion commented May 18, 2021

@protosse yes its fine for carthage. You should alse update your branch with the latest master, I have update to project to Xcode 12.5 and fix the build scripts.

Copy link
Member

@lucdion lucdion left a comment

Choose a reason for hiding this comment

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

Excellent job 👌

@lucdion lucdion merged commit c33d7ab into layoutBox:master May 18, 2021
@lucdion
Copy link
Member

lucdion commented May 18, 2021

I have published this new release https://github.com/layoutBox/PinLayout/releases/tag/1.10.0 that includes this PR.
Thanks again!

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

Successfully merging this pull request may close these issues.

3 participants