40

I know that UIStackview is a new feature in iOS 9. If I want my app to support iOS 8 or iOS 7, does that mean I shouldn't use stack views?

Ted
  • 22,696
  • 11
  • 95
  • 109

4 Answers4

42

It looks like it's for iOS 9+.

UIStackView

Availability

Available in iOS 9.0 and later

Community
  • 1
  • 1
Jeffery Thomas
  • 42,202
  • 8
  • 92
  • 117
16

UIStackView is only available in "iOS 9.0 and later".

If you need to support earlier versions of iOS, check out OAStackView, a drop-in replacement which "implements most of the features from UIStackView" and supports iOS 7+.

A few minor features haven't been finished yet. I tried it out using the UIStackView-Playground project and it works pretty well.

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
  • 2
    nice API! If I set one of the subviews hidden, would OAStackView adjust the constraints automatically? – Ted Jun 24 '15 at 03:26
  • hi @Yon, since when? – Ted Feb 02 '16 at 07:32
  • @Ted Recently I am using OAStackView in my project. I have tested this feature by myself. – YON Feb 02 '16 at 07:35
  • Does OAStackView automatically set constraints like the UIStackView? It doesn't seem to be doing it for mine. – ML. Feb 27 '16 at 09:13
2

You could also check out MarkupKit (I'm the project's author):

https://github.com/gk-brown/MarkupKit

The LMColumnView and LMRowView classes are very similar to UIStackView but work with iOS 8. They also have a couple features that UIStackView doesn't have, such as the ability to set a background color and weight-based distribution.

See this article for more information:

https://gkbrown.wordpress.com/2015/09/29/using-uistackview-with-markupkit/

Greg Brown
  • 3,168
  • 1
  • 27
  • 37
-1

UIStackView is supported only in iOS 9+. For people looking for a backport to iOS7/8:

https://github.com/oarrabi/OAStackView

K.K
  • 2,647
  • 1
  • 26
  • 32