tomvanzummeren / TZStackView

UIStackView replica for iOS 7.x and iOS 8.x
MIT License
1.16k stars 129 forks source link

Fixup TZStackViewAlignment #60

Open fbartho opened 8 years ago

fbartho commented 8 years ago

This PR updates TZStackViewAlignment to match UIStackViewAlignment and has some minor updates for iOS deprecations / consistency in documentation & test project.

Background

We noticed some discrepancies between the functionality of iOS 9.x UIStackView and iOS 8.x TZStackView. Specifically, we noticed that the following did not work as expected:

stack.alignment = UIStackViewAlignmentCenter;

Things discovered:

  1. TZStackViewAlignment had a different order of enum values than UIStackViewAlignment. This mismatch meant that the above assignment didn't go as planned.
  2. The code was using deprecated methods addConstraint()/addConstraints()
  3. The code was using other methods that required 8.x support.
  4. The xcodeproj was set to deployment target of 8.0, but the README.md claimed 7.x support.

These were all brought to consistency in this PR, along with using NSLayoutConstraint.activateConstraints()

fbartho commented 8 years ago

Please see #63 instead of this PR if iOS 7 support is important.