Skip to content

Commit

Permalink
Merge pull request #8 from jeantimex/update-example-project
Browse files Browse the repository at this point in the history
Updated example project and make it up and running.
  • Loading branch information
jeantimex authored Jul 21, 2017
2 parents d7fac27 + 0053a8c commit 1aa7b5c
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CollapsibleTableSectionViewController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "CollapsibleTableSectionViewController"
s.version = "0.0.4"
s.version = "0.0.5"
s.summary = "Swift 3.0 library to support collapsible sections in a table view."

# This description is used to generate tags and improve search results.
Expand Down
26 changes: 26 additions & 0 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
objects = {

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

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

/* Begin PBXGroup section */
0A8BD63B1F229BB6003D6155 /* Classes */ = {
isa = PBXGroup;
children = (
0A8BD63C1F229BD4003D6155 /* CollapsibleTableSectionViewController.swift */,
0A8BD63D1F229BD4003D6155 /* CollapsibleTableViewCell.swift */,
0A8BD63E1F229BD4003D6155 /* CollapsibleTableViewHeader.swift */,
0A8BD63F1F229BD4003D6155 /* Extensions.swift */,
);
name = Classes;
path = Examples;
sourceTree = "<group>";
};
0AC886D21F226627007E4E2F = {
isa = PBXGroup;
children = (
0A8BD63B1F229BB6003D6155 /* Classes */,
0AC886DD1F226627007E4E2F /* Examples */,
0AC886DC1F226627007E4E2F /* Products */,
);
Expand Down Expand Up @@ -137,7 +158,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0A8BD6421F229BD4003D6155 /* CollapsibleTableViewHeader.swift in Sources */,
0A8BD6431F229BD4003D6155 /* Extensions.swift in Sources */,
0A8BD6401F229BD4003D6155 /* CollapsibleTableSectionViewController.swift in Sources */,
0AC886E11F226627007E4E2F /* ViewController.swift in Sources */,
0A8BD6411F229BD4003D6155 /* CollapsibleTableViewCell.swift in Sources */,
0AC886DF1F226627007E4E2F /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -306,6 +331,7 @@
0AC886EF1F226627007E4E2F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
31 changes: 27 additions & 4 deletions Examples/Examples/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<?xml version="1.0" encoding="UTF-8"?>
<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">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Examples" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
Expand All @@ -18,9 +21,29 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<navigationItem key="navigationItem" id="fZN-sD-awh"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1076" y="137.18140929535232"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="0Ma-0x-VRy">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="HDu-hN-Zaj" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="jpL-Zf-9JA">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="i2Q-Oa-UcY"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="CYX-JS-QN0" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="78" y="137"/>
</scene>
</scenes>
</document>
51 changes: 42 additions & 9 deletions Examples/Examples/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,50 @@
import UIKit

class ViewController: UIViewController {


var sections = [Section]()

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.

self.title = "Apple Products"

let controller: CollapsibleTableSectionViewController = CollapsibleTableSectionViewController()

controller.sections = [
Section(name: "Mac", items: [
Item(name: "MacBook", detail: "Apple's ultraportable laptop, trading portability for speed and connectivity."),
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."),
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."),
Item(name: "iMac", detail: "iMac combines enhanced performance with our best ever Retina display for the ultimate desktop experience in two sizes."),
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."),
Item(name: "Mac mini", detail: "Mac mini is an affordable powerhouse that packs the entire Mac experience into a 7.7-inch-square frame."),
Item(name: "OS X El Capitan", detail: "The twelfth major release of OS X (now named macOS)."),
Item(name: "Accessories", detail: "")
]),
Section(name: "iPad", items: [
Item(name: "iPad Pro", detail: "iPad Pro delivers epic power, in 12.9-inch and a new 10.5-inch size."),
Item(name: "iPad Air 2", detail: "The second-generation iPad Air tablet computer designed, developed, and marketed by Apple Inc."),
Item(name: "iPad mini 4", detail: "iPad mini 4 puts uncompromising performance and potential in your hand."),
Item(name: "Accessories", detail: "")
]),
Section(name: "iPhone", items: [
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."),
Item(name: "iPhone 6", detail: "The iPhone 6 and iPhone 6 Plus are smartphones designed and marketed by Apple Inc."),
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."),
Item(name: "Accessories", detail: "")
])
]

let tableView: UITableView = controller.tableView

var frame = self.view.bounds
frame.origin.y = (navigationController?.navigationBar.frame.maxY)!

tableView.frame = frame

view.addSubview(tableView)
}



}

0 comments on commit 1aa7b5c

Please sign in to comment.