Skip to content

Commit

Permalink
Fix layoutMarginsRelativeArrangement to align to margin attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperkins committed Sep 18, 2015
1 parent aaef1db commit 11beb29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TZStackView/TZStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ public class TZStackView: UIView {

if layoutMarginsRelativeArrangement {
if spacerViews.count > 0 {
stackViewConstraints.append(constraint(item: self, attribute: .Bottom, toItem: spacerViews[0]))
stackViewConstraints.append(constraint(item: self, attribute: .Left, toItem: spacerViews[0]))
stackViewConstraints.append(constraint(item: self, attribute: .Right, toItem: spacerViews[0]))
stackViewConstraints.append(constraint(item: self, attribute: .Top, toItem: spacerViews[0]))
stackViewConstraints.append(constraint(item: self, attribute: .BottomMargin, toItem: spacerViews[0]))
stackViewConstraints.append(constraint(item: self, attribute: .LeftMargin, toItem: spacerViews[0]))
stackViewConstraints.append(constraint(item: self, attribute: .RightMargin, toItem: spacerViews[0]))
stackViewConstraints.append(constraint(item: self, attribute: .TopMargin, toItem: spacerViews[0]))
}
}
addConstraints(stackViewConstraints)
Expand Down

4 comments on commit 11beb29

@PabloLerma
Copy link

Choose a reason for hiding this comment

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

Hi, I think this change break the iOS7 compatibility, isn't it?

@CosynPa
Copy link

@CosynPa CosynPa commented on 11beb29 Nov 4, 2015

Choose a reason for hiding this comment

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

Can't compile in iOS 7

@tomvanzummeren
Copy link
Owner

Choose a reason for hiding this comment

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

You are right. I don't have much time to address this though.

Can any of you make a pull request that addresses this issue. Ideally I would like a solution where in iOS 8 the BottomMargin, LeftMargin etc is used and on iOS 7 the Bottom, Left etc attributes.

Is that possible?

@joshuafeldman
Copy link

Choose a reason for hiding this comment

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

In Swift you can easily make it a conditional if #available(iOS 8.0, *)

Please sign in to comment.