-
Notifications
You must be signed in to change notification settings - Fork 320
/
FDStackView.podspec
62 lines (45 loc) · 3.7 KB
/
FDStackView.podspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Pod::Spec.new do |s|
s.name = "FDStackView"
s.version = "1.0.1"
s.summary = "Use UIStackView as if it supports iOS6+."
s.description = <<-DESC
# 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
**Import nothing, learn nothing, it just works.**
- It will automatically replace the symbol for UIStackView into FDStackView at runtime before iOS9.
``` objc
// 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](https://raw.githubusercontent.com/forkingdog/FDStackView/master/Snapshots/snapshot0.png)
Now, use UIStackView as you like and its reactive options and live preview:
![UIStackView preview in IB](https://raw.githubusercontent.com/forkingdog/FDStackView/master/Snapshots/snapshot1.png)
# Requirements
- Xcode 7+ (For interface builder supports and the latest Objective-C Syntax)
- Base SDK iOS 9.0+ (To link UIStackView symbol in UIKit)
DESC
s.homepage = "https://github.com/forkingdog/FDStackView"
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.license = { :type => "MIT", :file => "LICENSE" }
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.author = { "forkingdog group" => "https://github.com/forkingdog" }
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.platform = :ios, "6.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.source = { :git => "https://github.com/forkingdog/FDStackView.git", :tag => "1.0.1" }
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.source_files = "FDStackView/*.{h,m}"
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.requires_arc = true
end