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...
exyte

     

camerakit-ios

CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service ...

HybridCamera

[video width="192" height="416" mp4="https://swiftgit.com/wp-content/uploads/2024/12/68747470733a2f2f7261776769742e636f6d2f7374796c656b69742f696d672f6d61737465722f7669645f6564697465645f325f326d622e676966.mp4"][/video]

TakeASelfie

An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front ...

iOS-Depth-Sampler

Code examples of Depth APIs in iOS