Skip to content

Commit 8354646

Browse files
committed
Merge branch 'tableView'
2 parents 4ac137f + b59da0e commit 8354646

File tree

11 files changed

+527
-27
lines changed

11 files changed

+527
-27
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// RevealServer.h
3+
// RevealServer
4+
//
5+
// Created by Tony Arnold on 25/11/2015.
6+
// Copyright © 2015 Itty Bitty Apps, Pty Ltd. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
//! Project version number for RevealServer.
12+
FOUNDATION_EXPORT double RevealServerVersionNumber;
13+
14+
//! Project version string for RevealServer.
15+
FOUNDATION_EXPORT const unsigned char RevealServerVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like #import <RevealServer/PublicHeader.h>
18+
19+

RevealServer.framework/Info.plist

790 Bytes
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
framework module RevealServer {
2+
umbrella header "RevealServer.h"
3+
4+
export *
5+
module * { export * }
6+
}
4.05 MB
Binary file not shown.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
set -o errexit
3+
set -o nounset
4+
5+
# Ensure that we have a valid OTHER_LDFLAGS environment variable
6+
OTHER_LDFLAGS=${OTHER_LDFLAGS:=""}
7+
8+
# Ensure that we have a valid REVEAL_SERVER_FILENAME environment variable
9+
REVEAL_SERVER_FILENAME=${REVEAL_SERVER_FILENAME:="RevealServer.framework"}
10+
11+
# Ensure that we have a valid REVEAL_SERVER_PATH environment variable
12+
REVEAL_SERVER_PATH=${REVEAL_SERVER_PATH:="${SRCROOT}/${REVEAL_SERVER_FILENAME}"}
13+
14+
# The path to copy the framework to
15+
app_frameworks_dir="${CODESIGNING_FOLDER_PATH}/Frameworks"
16+
17+
copy_library() {
18+
mkdir -p "$app_frameworks_dir"
19+
cp -vRf "$REVEAL_SERVER_PATH" "${app_frameworks_dir}/${REVEAL_SERVER_FILENAME}"
20+
}
21+
22+
codesign_library() {
23+
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then
24+
codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${app_frameworks_dir}/${REVEAL_SERVER_FILENAME}"
25+
fi
26+
}
27+
28+
main() {
29+
if [[ $OTHER_LDFLAGS =~ "RevealServer" ]]; then
30+
if [ -e "$REVEAL_SERVER_PATH" ]; then
31+
copy_library
32+
codesign_library
33+
echo "${REVEAL_SERVER_FILENAME} is included in this build, and has been copied to $CODESIGNING_FOLDER_PATH"
34+
else
35+
echo "${REVEAL_SERVER_FILENAME} is not included in this build, as it could not be found at $REVEAL_SERVER_PATH"
36+
fi
37+
else
38+
echo "${REVEAL_SERVER_FILENAME} is not included in this build because RevealServer was not present in the OTHER_LDFLAGS environment variable."
39+
fi
40+
}
41+
42+
main
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>files</key>
6+
<dict>
7+
<key>Headers/RevealServer.h</key>
8+
<data>
9+
e2S6Vuf8iJXurblvYWL8e3IMO7E=
10+
</data>
11+
<key>Info.plist</key>
12+
<data>
13+
3yuCXIz4oBBkDOLogLf3z8EtWn0=
14+
</data>
15+
<key>Modules/module.modulemap</key>
16+
<data>
17+
EuDEeG1dcC1sd+hIW2SkUAImUg8=
18+
</data>
19+
<key>Scripts/copy_and_codesign_revealserver.sh</key>
20+
<data>
21+
aQbLdf9lVnmDd2BfBMGsVPBPdb8=
22+
</data>
23+
</dict>
24+
<key>files2</key>
25+
<dict>
26+
<key>Headers/RevealServer.h</key>
27+
<dict>
28+
<key>hash</key>
29+
<data>
30+
e2S6Vuf8iJXurblvYWL8e3IMO7E=
31+
</data>
32+
<key>hash2</key>
33+
<data>
34+
i4zuiS2fsgwsoicYEzHuBx32JYfKW38gkopt/7FdINY=
35+
</data>
36+
</dict>
37+
<key>Modules/module.modulemap</key>
38+
<dict>
39+
<key>hash</key>
40+
<data>
41+
EuDEeG1dcC1sd+hIW2SkUAImUg8=
42+
</data>
43+
<key>hash2</key>
44+
<data>
45+
tstqiJpIPr4iEd3MDHClLuTB/ciSC/zNlke1AjfSVuU=
46+
</data>
47+
</dict>
48+
<key>Scripts/copy_and_codesign_revealserver.sh</key>
49+
<dict>
50+
<key>hash</key>
51+
<data>
52+
aQbLdf9lVnmDd2BfBMGsVPBPdb8=
53+
</data>
54+
<key>hash2</key>
55+
<data>
56+
UYSfYiTYxoDhVX7UwCYvPXGOWQ4Yrm5DzFoomMlSIMs=
57+
</data>
58+
</dict>
59+
</dict>
60+
<key>rules</key>
61+
<dict>
62+
<key>^</key>
63+
<true/>
64+
<key>^.*\.lproj/</key>
65+
<dict>
66+
<key>optional</key>
67+
<true/>
68+
<key>weight</key>
69+
<real>1000</real>
70+
</dict>
71+
<key>^.*\.lproj/locversion.plist$</key>
72+
<dict>
73+
<key>omit</key>
74+
<true/>
75+
<key>weight</key>
76+
<real>1100</real>
77+
</dict>
78+
<key>^version.plist$</key>
79+
<true/>
80+
</dict>
81+
<key>rules2</key>
82+
<dict>
83+
<key>.*\.dSYM($|/)</key>
84+
<dict>
85+
<key>weight</key>
86+
<real>11</real>
87+
</dict>
88+
<key>^</key>
89+
<dict>
90+
<key>weight</key>
91+
<real>20</real>
92+
</dict>
93+
<key>^(.*/)?\.DS_Store$</key>
94+
<dict>
95+
<key>omit</key>
96+
<true/>
97+
<key>weight</key>
98+
<real>2000</real>
99+
</dict>
100+
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
101+
<dict>
102+
<key>nested</key>
103+
<true/>
104+
<key>weight</key>
105+
<real>10</real>
106+
</dict>
107+
<key>^.*</key>
108+
<true/>
109+
<key>^.*\.lproj/</key>
110+
<dict>
111+
<key>optional</key>
112+
<true/>
113+
<key>weight</key>
114+
<real>1000</real>
115+
</dict>
116+
<key>^.*\.lproj/locversion.plist$</key>
117+
<dict>
118+
<key>omit</key>
119+
<true/>
120+
<key>weight</key>
121+
<real>1100</real>
122+
</dict>
123+
<key>^Info\.plist$</key>
124+
<dict>
125+
<key>omit</key>
126+
<true/>
127+
<key>weight</key>
128+
<real>20</real>
129+
</dict>
130+
<key>^PkgInfo$</key>
131+
<dict>
132+
<key>omit</key>
133+
<true/>
134+
<key>weight</key>
135+
<real>20</real>
136+
</dict>
137+
<key>^[^/]+$</key>
138+
<dict>
139+
<key>nested</key>
140+
<true/>
141+
<key>weight</key>
142+
<real>10</real>
143+
</dict>
144+
<key>^embedded\.provisionprofile$</key>
145+
<dict>
146+
<key>weight</key>
147+
<real>20</real>
148+
</dict>
149+
<key>^version\.plist$</key>
150+
<dict>
151+
<key>weight</key>
152+
<real>20</real>
153+
</dict>
154+
</dict>
155+
</dict>
156+
</plist>
Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="7T2-uk-2HS">
33
<dependencies>
44
<deployment identifier="iOS"/>
55
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
@@ -15,28 +15,44 @@
1515
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
1616
</layoutGuides>
1717
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
18+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
19+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
20+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
21+
</view>
22+
</viewController>
23+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
24+
</objects>
25+
<point key="canvasLocation" x="793" y="142"/>
26+
</scene>
27+
<!--View Controller-->
28+
<scene sceneID="J1t-eD-mqX">
29+
<objects>
30+
<viewController id="7T2-uk-2HS" sceneMemberID="viewController">
31+
<layoutGuides>
32+
<viewControllerLayoutGuide type="top" id="t5A-zv-W6A"/>
33+
<viewControllerLayoutGuide type="bottom" id="Ief-Ba-u8T"/>
34+
</layoutGuides>
35+
<view key="view" contentMode="scaleToFill" id="kwf-cN-PbM">
1836
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1937
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2038
<subviews>
21-
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1Zb-nQ-PZ0" customClass="StackScrollView" customModule="StackScrollView">
22-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
23-
</view>
39+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XRJ-Za-6jO">
40+
<state key="normal" title="Button"/>
41+
<connections>
42+
<segue destination="BYZ-38-t0r" kind="presentation" id="P88-30-pnT"/>
43+
</connections>
44+
</button>
2445
</subviews>
25-
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
46+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
2647
<constraints>
27-
<constraint firstAttribute="bottom" secondItem="1Zb-nQ-PZ0" secondAttribute="bottom" id="NOz-JJ-Ug8"/>
28-
<constraint firstItem="1Zb-nQ-PZ0" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="Wh8-iT-gKd"/>
29-
<constraint firstAttribute="trailing" secondItem="1Zb-nQ-PZ0" secondAttribute="trailing" id="ZLv-iv-Ve3"/>
30-
<constraint firstItem="1Zb-nQ-PZ0" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="a0d-hy-j9C"/>
48+
<constraint firstItem="XRJ-Za-6jO" firstAttribute="centerX" secondItem="kwf-cN-PbM" secondAttribute="centerX" id="fzA-0K-SDX"/>
49+
<constraint firstItem="XRJ-Za-6jO" firstAttribute="centerY" secondItem="kwf-cN-PbM" secondAttribute="centerY" id="pKu-OC-NnY"/>
3150
</constraints>
3251
</view>
33-
<connections>
34-
<outlet property="stackScrollView" destination="1Zb-nQ-PZ0" id="H30-gJ-GhA"/>
35-
</connections>
3652
</viewController>
37-
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
53+
<placeholder placeholderIdentifier="IBFirstResponder" id="Vy7-aX-cKh" userLabel="First Responder" sceneMemberID="firstResponder"/>
3854
</objects>
39-
<point key="canvasLocation" x="-58.399999999999999" y="131.78410794602701"/>
55+
<point key="canvasLocation" x="20" y="142"/>
4056
</scene>
4157
</scenes>
4258
</document>

StackScrollView-Demo/ViewController.swift

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,43 @@ class ViewController: UIViewController {
5151
}
5252
}
5353

54+
let topCells = (0...20).map { i -> LabelStackViewCell in
55+
LabelStackViewCell().then { cell in
56+
cell.backgroundColor = colorA
57+
cell.titleLabel.text = "\(i)"
58+
cell.detailLabel.text = "\(i)"
59+
}
60+
}
61+
62+
let mediumCells = [
63+
labelCell,
64+
switchCell,
65+
textFieldCell,
66+
]
67+
68+
let bottomCells = (20...40).map { i -> LabelStackViewCell in
69+
LabelStackViewCell().then { cell in
70+
cell.backgroundColor = colorA
71+
cell.titleLabel.text = "\(i)"
72+
cell.detailLabel.text = "\(i)"
73+
}
74+
}
75+
5476
stackScrollView.append(
55-
views: [
56-
labelCell,
57-
switchCell,
58-
labelFromTextCell,
59-
textFieldCell,
60-
],
61-
animated: true)
77+
views: [labelFromTextCell] + [topCells, mediumCells, bottomCells].flatMap { $0 },
78+
animated: false)
79+
80+
stackScrollView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
81+
stackScrollView.frame = view.bounds
82+
view.addSubview(stackScrollView)
6283
}
6384

6485
override func didReceiveMemoryWarning() {
6586
super.didReceiveMemoryWarning()
6687
// Dispose of any resources that can be recreated.
6788
}
6889

69-
@IBOutlet weak var stackScrollView: StackScrollView!
90+
private var stackScrollView = StackScrollView()
7091
}
7192

7293
class LabelStackViewCell: UIView {
@@ -100,7 +121,7 @@ class LabelStackViewCell: UIView {
100121
let detailLabel = UILabel()
101122
}
102123

103-
class SwitchStackViewCell: UIView {
124+
class SwitchStackViewCell: UIView, StackScrollViewCellType {
104125

105126
var valueChanged: (Bool) -> Void = { _ in }
106127

@@ -124,7 +145,7 @@ class SwitchStackViewCell: UIView {
124145
}
125146

126147
override var intrinsicContentSize : CGSize {
127-
return CGSize(width: UIViewNoIntrinsicMetric, height: 60)
148+
return CGSize(width: UIViewNoIntrinsicMetric, height: switchView.isOn ? 60 : 200)
128149
}
129150

130151
required init?(coder aDecoder: NSCoder) {
@@ -137,7 +158,8 @@ class SwitchStackViewCell: UIView {
137158

138159
@objc fileprivate func switchValueChanged() {
139160

140-
valueChanged(switchView.isOn)
161+
valueChanged(switchView.isOn)
162+
updateLayout(animated: true)
141163
}
142164
}
143165

0 commit comments

Comments
 (0)