diff --git a/PureLayout/PureLayout/ALView+PureLayout.h b/PureLayout/PureLayout/ALView+PureLayout.h index d70d730..5153479 100755 --- a/PureLayout/PureLayout/ALView+PureLayout.h +++ b/PureLayout/PureLayout/ALView+PureLayout.h @@ -104,6 +104,9 @@ /** Pins the given edge of the view to the same edge of its superview with an inset as a maximum or minimum. */ - (NSLayoutConstraint *)autoPinEdgeToSuperviewEdge:(ALEdge)edge withInset:(CGFloat)inset relation:(NSLayoutRelation)relation; +/** Pins the edges of the view to the edges of its superview. */ +- (NSArray *)autoPinEdgesToSuperviewEdges; + /** Pins the edges of the view to the edges of its superview with the given edge insets. */ - (NSArray *)autoPinEdgesToSuperviewEdgesWithInsets:(ALEdgeInsets)insets; diff --git a/PureLayout/PureLayout/ALView+PureLayout.m b/PureLayout/PureLayout/ALView+PureLayout.m index 2841b4c..eabe8a3 100755 --- a/PureLayout/PureLayout/ALView+PureLayout.m +++ b/PureLayout/PureLayout/ALView+PureLayout.m @@ -376,6 +376,16 @@ - (NSLayoutConstraint *)autoPinEdgeToSuperviewEdge:(ALEdge)edge withInset:(CGFlo return [self autoPinEdge:edge toEdge:edge ofView:superview withOffset:inset relation:relation]; } +/** + Pins the edges of the view to the edges of its superview. + + @return An array of constraints added. + */ +- (NSArray *)autoPinEdgesToSuperviewEdges +{ + return [self autoPinEdgesToSuperviewEdgesWithInsets:ALEdgeInsetsZero]; +} + /** Pins the edges of the view to the edges of its superview with the given edge insets. The insets.left corresponds to a leading edge constraint, and insets.right corresponds to a trailing edge constraint. diff --git a/README.md b/README.md index fd7fa12..dacc0e1 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Additionally, there is one generic attribute type, `ALAttribute`, which is effec - autoCenterInSuperviewMargins: // iOS 8.0+ only - autoAlignAxisToSuperviewMarginAxis: // iOS 8.0+ only - autoPinEdgeToSuperviewEdge:(withInset:) - - autoPinEdgesToSuperviewEdgesWithInsets:(excludingEdge:) + - autoPinEdgesToSuperviewEdges(WithInsets:)(excludingEdge:) - autoPinEdgeToSuperviewMargin: // iOS 8.0+ only - autoPinEdgesToSuperviewMargins(ExcludingEdge:) // iOS 8.0+ only - autoPinEdge:toEdge:ofView:(withOffset:)