FDStackView
  • August 1, 2023

Problem


UIStackView is a very handy tool to build flow layout, but it’s available only when iOS9+, we’ve found some great compatible replacements like OAStackView, but we want more:

  • Perfect downward compatible, no infectivity, use UIStackView directly as if it’s shipped from iOS6.
  • Interface builder support, live preview.
  • Keep layout constraints as closely as UIStackView constructs.

Usage


Podfile

platform :ios, ‘7.0’
pod “FDStackView”, “1.0”

Import nothing, learn nothing, it just works.

  • It will automatically replace the symbol for UIStackView into FDStackView at runtime before iOS9.

// Works in iOS6+, use it directly.
UIStackView *stackView = [[UIStackView alloc] init];
stackView.axis = UILayoutConstraintAxisHorizontal;
stackView.distribution = UIStackViewDistributionFill;
stackView.alignment = UIStackViewAlignmentTop;
[stackView addArrangedSubview:[[UILabel alloc] init]];
[self.view addSubview:stackView];

  • Interface Builder Support

Set Builds for option to iOS 9.0 and later to eliminate the version error in Xcode:

How to use in IB

Now, use UIStackView as you like and its reactive options and live preview:

UIStackView preview in IB

Requirements


  • Xcode 7+ (For interface builder supports and the latest Objective-C Syntax)
  • Base SDK iOS 9.0+ (To link UIStackView symbol in UIKit)

Versions


  • 1.0.1 is the lastest version. We released it after we have used it in our official application. And it was successfully passed through the App Store’s review. So you have no concern to use it.

GitHub


View Github

#StackView
YOU MIGHT ALSO LIKE...
SwiftUI Charts

Build custom charts with SwiftUI Styles

SwiftUICharts

A simple line and bar charting library that support accessibility written using SwiftUI.

Swipeable cards

Swipeable Cards with SwiftUI

RGStack

This UI attempts to capture the Quibi Card Stack and the associated User Interaction.

🃏 CardStack

A easy-to-use SwiftUI view for Tinder like cards on iOS, macOS & watchOS.