diff --git a/CollapsibleTableSectionViewController.podspec b/CollapsibleTableSectionViewController.podspec index ffd3da5..a15fc8f 100644 --- a/CollapsibleTableSectionViewController.podspec +++ b/CollapsibleTableSectionViewController.podspec @@ -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. diff --git a/Examples/Examples.xcodeproj/project.pbxproj b/Examples/Examples.xcodeproj/project.pbxproj index 430627b..2df7ed1 100644 --- a/Examples/Examples.xcodeproj/project.pbxproj +++ b/Examples/Examples.xcodeproj/project.pbxproj @@ -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 */; }; @@ -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 = ""; }; + 0A8BD63D1F229BD4003D6155 /* CollapsibleTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CollapsibleTableViewCell.swift; path = ../../Classes/CollapsibleTableViewCell.swift; sourceTree = ""; }; + 0A8BD63E1F229BD4003D6155 /* CollapsibleTableViewHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CollapsibleTableViewHeader.swift; path = ../../Classes/CollapsibleTableViewHeader.swift; sourceTree = ""; }; + 0A8BD63F1F229BD4003D6155 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = ../../Classes/Extensions.swift; sourceTree = ""; }; 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 = ""; }; 0AC886E01F226627007E4E2F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -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 = ""; + }; 0AC886D21F226627007E4E2F = { isa = PBXGroup; children = ( + 0A8BD63B1F229BB6003D6155 /* Classes */, 0AC886DD1F226627007E4E2F /* Examples */, 0AC886DC1F226627007E4E2F /* Products */, ); @@ -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; @@ -306,6 +331,7 @@ 0AC886EF1F226627007E4E2F /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Examples/Examples/Base.lproj/Main.storyboard b/Examples/Examples/Base.lproj/Main.storyboard index 273375f..4d1eaa8 100644 --- a/Examples/Examples/Base.lproj/Main.storyboard +++ b/Examples/Examples/Base.lproj/Main.storyboard @@ -1,14 +1,17 @@ - - + + + + + - + - + @@ -18,9 +21,29 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/Examples/ViewController.swift b/Examples/Examples/ViewController.swift index 99f4b3c..9ebf78f 100644 --- a/Examples/Examples/ViewController.swift +++ b/Examples/Examples/ViewController.swift @@ -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) } - - + }