Skip to content

Conversation

@toohotz
Copy link
Member

@toohotz toohotz commented Feb 23, 2018

PR addressing issue #204.

[constraints addObject:[self autoPinEdgeToSuperviewMargin:ALEdgeLeading]];
[constraints addObject:[self autoPinEdgeToSuperviewMargin:ALEdgeBottom]];
[constraints addObject:[self autoPinEdgeToSuperviewMargin:ALEdgeTrailing]];
return constraints;
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this method be now simplified by using the new autoPinEdgesToSuperviewMarginsWithInsets method and passing the ALEdgeInsets as zero? This way we could avoid duplicated code.

The same applies to the autoPinEdgeToSuperviewMargin: withInset: method.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, -[autoPinEdgesToSuperviewMargins] makes sense to simplify with AlEdgeInsetsZero but that one differs from the -[autoPinEdgeToSuperviewMargin: withInset:] because here the relation does matter and there is no single method currently that does -[autoPinEdgeToSuperviewMargin: withInset: relation:]. Now if something like that is desired then yes, it could simplify things but that would affect backwards compatibility if those two methods were combined into a single one and the singular ones deprecated / removed. So for now, I can amend the changes for -[autoPinEdgesToSuperviewMargins]. Thanks for the feedback, well appreciated 👍

Copy link
Member

Choose a reason for hiding this comment

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

Cool, makes sense 👌.

@tomidelucca
Copy link
Member

First of all, hi! I'm super excited to be here. I hope we can bring this library back to life now that we have a little more control over it.

inset = -inset;
}
ALMargin margin = [NSLayoutConstraint al_marginForEdge:edge];

Copy link

Choose a reason for hiding this comment

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

Just to be consistent, can we remove redundant newline?

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course, thanks for catching.

Copy link

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

@mickeyreiss mickeyreiss left a comment

Choose a reason for hiding this comment

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

@toohotz thanks for being an awesome contributor! Much appreciated. Did you consider including some coverage for the new signatures in tests/readme/demo apps? I think that would be helpful for people who are trying to understand how these two new methods work.

@toohotz
Copy link
Member Author

toohotz commented Feb 28, 2018

@mickeyreiss Absolutely, tends to escape me to update the README but I'll do so and add in corresponding signatures in the tests along with the demo apps. Appreciate the feedback. 👍🏾

@toohotz
Copy link
Member Author

toohotz commented Mar 5, 2018

@mickeyreiss The signatures are included in the README they were just missing as someone had noted as well as the demo project has already signatures for margins so the understanding is there on how it is to be used just that it was missing 🤓. I added a few tests for the margins also.

@toohotz toohotz merged commit 14e07f9 into PureLayout:master Mar 5, 2018
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.

4 participants