Skip to content

Commit 1aa7b5c

Browse files
authored
Merge pull request #8 from jeantimex/update-example-project
Updated example project and make it up and running.
2 parents d7fac27 + 0053a8c commit 1aa7b5c

4 files changed

Lines changed: 96 additions & 14 deletions

File tree

CollapsibleTableSectionViewController.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "CollapsibleTableSectionViewController"
19-
s.version = "0.0.4"
19+
s.version = "0.0.5"
2020
s.summary = "Swift 3.0 library to support collapsible sections in a table view."
2121

2222
# This description is used to generate tags and improve search results.

Examples/Examples.xcodeproj/project.pbxproj

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
0A8BD6401F229BD4003D6155 /* CollapsibleTableSectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8BD63C1F229BD4003D6155 /* CollapsibleTableSectionViewController.swift */; };
11+
0A8BD6411F229BD4003D6155 /* CollapsibleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8BD63D1F229BD4003D6155 /* CollapsibleTableViewCell.swift */; };
12+
0A8BD6421F229BD4003D6155 /* CollapsibleTableViewHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8BD63E1F229BD4003D6155 /* CollapsibleTableViewHeader.swift */; };
13+
0A8BD6431F229BD4003D6155 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A8BD63F1F229BD4003D6155 /* Extensions.swift */; };
1014
0AC886DF1F226627007E4E2F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC886DE1F226627007E4E2F /* AppDelegate.swift */; };
1115
0AC886E11F226627007E4E2F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC886E01F226627007E4E2F /* ViewController.swift */; };
1216
0AC886E41F226627007E4E2F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0AC886E21F226627007E4E2F /* Main.storyboard */; };
@@ -15,6 +19,10 @@
1519
/* End PBXBuildFile section */
1620

1721
/* Begin PBXFileReference section */
22+
0A8BD63C1F229BD4003D6155 /* CollapsibleTableSectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CollapsibleTableSectionViewController.swift; path = ../../Classes/CollapsibleTableSectionViewController.swift; sourceTree = "<group>"; };
23+
0A8BD63D1F229BD4003D6155 /* CollapsibleTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CollapsibleTableViewCell.swift; path = ../../Classes/CollapsibleTableViewCell.swift; sourceTree = "<group>"; };
24+
0A8BD63E1F229BD4003D6155 /* CollapsibleTableViewHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CollapsibleTableViewHeader.swift; path = ../../Classes/CollapsibleTableViewHeader.swift; sourceTree = "<group>"; };
25+
0A8BD63F1F229BD4003D6155 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = ../../Classes/Extensions.swift; sourceTree = "<group>"; };
1826
0AC886DB1F226627007E4E2F /* Examples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Examples.app; sourceTree = BUILT_PRODUCTS_DIR; };
1927
0AC886DE1F226627007E4E2F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2028
0AC886E01F226627007E4E2F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -35,9 +43,22 @@
3543
/* End PBXFrameworksBuildPhase section */
3644

3745
/* Begin PBXGroup section */
46+
0A8BD63B1F229BB6003D6155 /* Classes */ = {
47+
isa = PBXGroup;
48+
children = (
49+
0A8BD63C1F229BD4003D6155 /* CollapsibleTableSectionViewController.swift */,
50+
0A8BD63D1F229BD4003D6155 /* CollapsibleTableViewCell.swift */,
51+
0A8BD63E1F229BD4003D6155 /* CollapsibleTableViewHeader.swift */,
52+
0A8BD63F1F229BD4003D6155 /* Extensions.swift */,
53+
);
54+
name = Classes;
55+
path = Examples;
56+
sourceTree = "<group>";
57+
};
3858
0AC886D21F226627007E4E2F = {
3959
isa = PBXGroup;
4060
children = (
61+
0A8BD63B1F229BB6003D6155 /* Classes */,
4162
0AC886DD1F226627007E4E2F /* Examples */,
4263
0AC886DC1F226627007E4E2F /* Products */,
4364
);
@@ -137,7 +158,11 @@
137158
isa = PBXSourcesBuildPhase;
138159
buildActionMask = 2147483647;
139160
files = (
161+
0A8BD6421F229BD4003D6155 /* CollapsibleTableViewHeader.swift in Sources */,
162+
0A8BD6431F229BD4003D6155 /* Extensions.swift in Sources */,
163+
0A8BD6401F229BD4003D6155 /* CollapsibleTableSectionViewController.swift in Sources */,
140164
0AC886E11F226627007E4E2F /* ViewController.swift in Sources */,
165+
0A8BD6411F229BD4003D6155 /* CollapsibleTableViewCell.swift in Sources */,
141166
0AC886DF1F226627007E4E2F /* AppDelegate.swift in Sources */,
142167
);
143168
runOnlyForDeploymentPostprocessing = 0;
@@ -306,6 +331,7 @@
306331
0AC886EF1F226627007E4E2F /* Release */,
307332
);
308333
defaultConfigurationIsVisible = 0;
334+
defaultConfigurationName = Release;
309335
};
310336
/* End XCConfigurationList section */
311337
};
Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" 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="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HDu-hN-Zaj">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
7+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
58
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
69
</dependencies>
710
<scenes>
811
<!--View Controller-->
912
<scene sceneID="tne-QT-ifu">
1013
<objects>
11-
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
14+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Examples" customModuleProvider="target" sceneMemberID="viewController">
1215
<layoutGuides>
1316
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
1417
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -18,9 +21,29 @@
1821
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1922
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2023
</view>
24+
<navigationItem key="navigationItem" id="fZN-sD-awh"/>
2125
</viewController>
2226
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
2327
</objects>
28+
<point key="canvasLocation" x="1076" y="137.18140929535232"/>
29+
</scene>
30+
<!--Navigation Controller-->
31+
<scene sceneID="0Ma-0x-VRy">
32+
<objects>
33+
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="HDu-hN-Zaj" sceneMemberID="viewController">
34+
<toolbarItems/>
35+
<navigationBar key="navigationBar" contentMode="scaleToFill" id="jpL-Zf-9JA">
36+
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
37+
<autoresizingMask key="autoresizingMask"/>
38+
</navigationBar>
39+
<nil name="viewControllers"/>
40+
<connections>
41+
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="i2Q-Oa-UcY"/>
42+
</connections>
43+
</navigationController>
44+
<placeholder placeholderIdentifier="IBFirstResponder" id="CYX-JS-QN0" userLabel="First Responder" sceneMemberID="firstResponder"/>
45+
</objects>
46+
<point key="canvasLocation" x="78" y="137"/>
2447
</scene>
2548
</scenes>
2649
</document>

Examples/Examples/ViewController.swift

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,50 @@
99
import UIKit
1010

1111
class ViewController: UIViewController {
12-
12+
13+
var sections = [Section]()
14+
1315
override func viewDidLoad() {
1416
super.viewDidLoad()
15-
// Do any additional setup after loading the view, typically from a nib.
16-
}
17-
18-
override func didReceiveMemoryWarning() {
19-
super.didReceiveMemoryWarning()
20-
// Dispose of any resources that can be recreated.
17+
18+
self.title = "Apple Products"
19+
20+
let controller: CollapsibleTableSectionViewController = CollapsibleTableSectionViewController()
21+
22+
controller.sections = [
23+
Section(name: "Mac", items: [
24+
Item(name: "MacBook", detail: "Apple's ultraportable laptop, trading portability for speed and connectivity."),
25+
Item(name: "MacBook Air", detail: "While the screen could be sharper, the updated 11-inch MacBook Air is a very light ultraportable that offers great performance and battery life for the price."),
26+
Item(name: "MacBook Pro", detail: "Retina Display The brightest, most colorful Mac notebook display ever. The display in the MacBook Pro is the best ever in a Mac notebook."),
27+
Item(name: "iMac", detail: "iMac combines enhanced performance with our best ever Retina display for the ultimate desktop experience in two sizes."),
28+
Item(name: "Mac Pro", detail: "Mac Pro is equipped with pro-level graphics, storage, expansion, processing power, and memory. It's built for creativity on an epic scale."),
29+
Item(name: "Mac mini", detail: "Mac mini is an affordable powerhouse that packs the entire Mac experience into a 7.7-inch-square frame."),
30+
Item(name: "OS X El Capitan", detail: "The twelfth major release of OS X (now named macOS)."),
31+
Item(name: "Accessories", detail: "")
32+
]),
33+
Section(name: "iPad", items: [
34+
Item(name: "iPad Pro", detail: "iPad Pro delivers epic power, in 12.9-inch and a new 10.5-inch size."),
35+
Item(name: "iPad Air 2", detail: "The second-generation iPad Air tablet computer designed, developed, and marketed by Apple Inc."),
36+
Item(name: "iPad mini 4", detail: "iPad mini 4 puts uncompromising performance and potential in your hand."),
37+
Item(name: "Accessories", detail: "")
38+
]),
39+
Section(name: "iPhone", items: [
40+
Item(name: "iPhone 6s", detail: "The iPhone 6S has a similar design to the 6 but updated hardware, including a strengthened chassis and upgraded system-on-chip, a 12-megapixel camera, improved fingerprint recognition sensor, and LTE Advanced support."),
41+
Item(name: "iPhone 6", detail: "The iPhone 6 and iPhone 6 Plus are smartphones designed and marketed by Apple Inc."),
42+
Item(name: "iPhone SE", detail: "The iPhone SE was received positively by critics, who noted its familiar form factor and design, improved hardware over previous 4-inch iPhone models, as well as its overall performance and battery life."),
43+
Item(name: "Accessories", detail: "")
44+
])
45+
]
46+
47+
let tableView: UITableView = controller.tableView
48+
49+
var frame = self.view.bounds
50+
frame.origin.y = (navigationController?.navigationBar.frame.maxY)!
51+
52+
tableView.frame = frame
53+
54+
view.addSubview(tableView)
2155
}
22-
23-
56+
2457
}
2558

0 commit comments

Comments
 (0)