-
Notifications
You must be signed in to change notification settings - Fork 144
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK👌
合并好了吗,大佬 |
@protosse, you need to fix the compilation of the objective-c unit tests ( |
There was a problem hiding this 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
docs/objective_c.md
Outdated
@@ -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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view.pinObjc.width().layout(); | |
view.pinObjc.width(100).layout(); |
@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? |
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent job 👌
I have published this new release https://github.com/layoutBox/PinLayout/releases/tag/1.10.0 that includes this PR. |
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.