From 7d35e3a0295ac8ea85690a07bf0608ab2198004a Mon Sep 17 00:00:00 2001 From: Serhii Kharauzov Date: Sat, 8 Jun 2019 20:40:20 +0300 Subject: [PATCH] Add demo project --- CollapseTableView.xcodeproj/project.pbxproj | 193 +++++++++++++++++- .../xcschemes/xcschememanagement.plist | 5 + CollapseTableViewDemo/AppDelegate.swift | 46 +++++ .../AppIcon.appiconset/Contents.json | 98 +++++++++ .../Assets.xcassets/Contents.json | 6 + .../arrow_down.imageset/Contents.json | 15 ++ .../arrow_down.imageset/arrow_down.pdf | Bin 0 -> 4024 bytes .../Base.lproj/LaunchScreen.storyboard | 25 +++ .../Base.lproj/Main.storyboard | 69 +++++++ CollapseTableViewDemo/Info.plist | 45 ++++ CollapseTableViewDemo/SectionHeaderView.swift | 19 ++ CollapseTableViewDemo/SectionHeaderView.xib | 43 ++++ CollapseTableViewDemo/ViewController.swift | 61 ++++++ 13 files changed, 623 insertions(+), 2 deletions(-) create mode 100644 CollapseTableViewDemo/AppDelegate.swift create mode 100644 CollapseTableViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 CollapseTableViewDemo/Assets.xcassets/Contents.json create mode 100644 CollapseTableViewDemo/Assets.xcassets/arrow_down.imageset/Contents.json create mode 100644 CollapseTableViewDemo/Assets.xcassets/arrow_down.imageset/arrow_down.pdf create mode 100644 CollapseTableViewDemo/Base.lproj/LaunchScreen.storyboard create mode 100644 CollapseTableViewDemo/Base.lproj/Main.storyboard create mode 100644 CollapseTableViewDemo/Info.plist create mode 100644 CollapseTableViewDemo/SectionHeaderView.swift create mode 100644 CollapseTableViewDemo/SectionHeaderView.xib create mode 100644 CollapseTableViewDemo/ViewController.swift diff --git a/CollapseTableView.xcodeproj/project.pbxproj b/CollapseTableView.xcodeproj/project.pbxproj index 364bb1e..6d77081 100644 --- a/CollapseTableView.xcodeproj/project.pbxproj +++ b/CollapseTableView.xcodeproj/project.pbxproj @@ -9,18 +9,68 @@ /* Begin PBXBuildFile section */ 4901DBBD22ABC747008CC400 /* CollapseSectionHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4901DBBB22ABC747008CC400 /* CollapseSectionHeader.swift */; }; 4901DBBE22ABC747008CC400 /* CollapseTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4901DBBC22ABC747008CC400 /* CollapseTableView.swift */; }; + 4919EFCE22AC25D400CD5A74 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4919EFCD22AC25D400CD5A74 /* AppDelegate.swift */; }; + 4919EFD022AC25D400CD5A74 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4919EFCF22AC25D400CD5A74 /* ViewController.swift */; }; + 4919EFD322AC25D400CD5A74 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4919EFD122AC25D400CD5A74 /* Main.storyboard */; }; + 4919EFD522AC25D500CD5A74 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4919EFD422AC25D500CD5A74 /* Assets.xcassets */; }; + 4919EFD822AC25D500CD5A74 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4919EFD622AC25D500CD5A74 /* LaunchScreen.storyboard */; }; + 4919EFDF22AC263D00CD5A74 /* SectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4919EFDD22AC263D00CD5A74 /* SectionHeaderView.swift */; }; + 4919EFE022AC263D00CD5A74 /* SectionHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4919EFDE22AC263D00CD5A74 /* SectionHeaderView.xib */; }; + 4919EFE122AC27A200CD5A74 /* CollapseTableView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4922F97122AAE53700967BB5 /* CollapseTableView.framework */; }; + 4919EFE222AC27A200CD5A74 /* CollapseTableView.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4922F97122AAE53700967BB5 /* CollapseTableView.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 4922F97622AAE53700967BB5 /* CollapseTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4922F97422AAE53700967BB5 /* CollapseTableView.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 4919EFE322AC27A200CD5A74 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4922F96822AAE53700967BB5 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4922F97022AAE53700967BB5; + remoteInfo = CollapseTableView; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 4919EFE522AC27A200CD5A74 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 4919EFE222AC27A200CD5A74 /* CollapseTableView.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 4901DBBB22ABC747008CC400 /* CollapseSectionHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollapseSectionHeader.swift; sourceTree = ""; }; 4901DBBC22ABC747008CC400 /* CollapseTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollapseTableView.swift; sourceTree = ""; }; + 4919EFCB22AC25D400CD5A74 /* CollapseTableViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CollapseTableViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4919EFCD22AC25D400CD5A74 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 4919EFCF22AC25D400CD5A74 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 4919EFD222AC25D400CD5A74 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 4919EFD422AC25D500CD5A74 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 4919EFD722AC25D500CD5A74 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 4919EFD922AC25D500CD5A74 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4919EFDD22AC263D00CD5A74 /* SectionHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SectionHeaderView.swift; sourceTree = ""; }; + 4919EFDE22AC263D00CD5A74 /* SectionHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SectionHeaderView.xib; sourceTree = ""; }; 4922F97122AAE53700967BB5 /* CollapseTableView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CollapseTableView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4922F97422AAE53700967BB5 /* CollapseTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CollapseTableView.h; sourceTree = ""; }; 4922F97522AAE53700967BB5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 4919EFC822AC25D400CD5A74 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4919EFE122AC27A200CD5A74 /* CollapseTableView.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4922F96E22AAE53700967BB5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -40,10 +90,26 @@ path = Source; sourceTree = ""; }; + 4919EFCC22AC25D400CD5A74 /* CollapseTableViewDemo */ = { + isa = PBXGroup; + children = ( + 4919EFCD22AC25D400CD5A74 /* AppDelegate.swift */, + 4919EFDD22AC263D00CD5A74 /* SectionHeaderView.swift */, + 4919EFDE22AC263D00CD5A74 /* SectionHeaderView.xib */, + 4919EFCF22AC25D400CD5A74 /* ViewController.swift */, + 4919EFD122AC25D400CD5A74 /* Main.storyboard */, + 4919EFD422AC25D500CD5A74 /* Assets.xcassets */, + 4919EFD622AC25D500CD5A74 /* LaunchScreen.storyboard */, + 4919EFD922AC25D500CD5A74 /* Info.plist */, + ); + path = CollapseTableViewDemo; + sourceTree = ""; + }; 4922F96722AAE53700967BB5 = { isa = PBXGroup; children = ( 4922F97322AAE53700967BB5 /* CollapseTableView */, + 4919EFCC22AC25D400CD5A74 /* CollapseTableViewDemo */, 4922F97222AAE53700967BB5 /* Products */, ); sourceTree = ""; @@ -52,6 +118,7 @@ isa = PBXGroup; children = ( 4922F97122AAE53700967BB5 /* CollapseTableView.framework */, + 4919EFCB22AC25D400CD5A74 /* CollapseTableViewDemo.app */, ); name = Products; sourceTree = ""; @@ -80,6 +147,25 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 4919EFCA22AC25D400CD5A74 /* CollapseTableViewDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4919EFDC22AC25D500CD5A74 /* Build configuration list for PBXNativeTarget "CollapseTableViewDemo" */; + buildPhases = ( + 4919EFC722AC25D400CD5A74 /* Sources */, + 4919EFC822AC25D400CD5A74 /* Frameworks */, + 4919EFC922AC25D400CD5A74 /* Resources */, + 4919EFE522AC27A200CD5A74 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 4919EFE422AC27A200CD5A74 /* PBXTargetDependency */, + ); + name = CollapseTableViewDemo; + productName = CollapseTableViewDemo; + productReference = 4919EFCB22AC25D400CD5A74 /* CollapseTableViewDemo.app */; + productType = "com.apple.product-type.application"; + }; 4922F97022AAE53700967BB5 /* CollapseTableView */ = { isa = PBXNativeTarget; buildConfigurationList = 4922F97922AAE53700967BB5 /* Build configuration list for PBXNativeTarget "CollapseTableView" */; @@ -104,9 +190,13 @@ 4922F96822AAE53700967BB5 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1020; LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Serhii Kharauzov"; TargetAttributes = { + 4919EFCA22AC25D400CD5A74 = { + CreatedOnToolsVersion = 10.2; + }; 4922F97022AAE53700967BB5 = { CreatedOnToolsVersion = 10.2; }; @@ -118,6 +208,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 4922F96722AAE53700967BB5; productRefGroup = 4922F97222AAE53700967BB5 /* Products */; @@ -125,11 +216,23 @@ projectRoot = ""; targets = ( 4922F97022AAE53700967BB5 /* CollapseTableView */, + 4919EFCA22AC25D400CD5A74 /* CollapseTableViewDemo */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 4919EFC922AC25D400CD5A74 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4919EFD822AC25D500CD5A74 /* LaunchScreen.storyboard in Resources */, + 4919EFD522AC25D500CD5A74 /* Assets.xcassets in Resources */, + 4919EFD322AC25D400CD5A74 /* Main.storyboard in Resources */, + 4919EFE022AC263D00CD5A74 /* SectionHeaderView.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4922F96F22AAE53700967BB5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -140,6 +243,16 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 4919EFC722AC25D400CD5A74 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4919EFD022AC25D400CD5A74 /* ViewController.swift in Sources */, + 4919EFDF22AC263D00CD5A74 /* SectionHeaderView.swift in Sources */, + 4919EFCE22AC25D400CD5A74 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4922F96D22AAE53700967BB5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -151,7 +264,76 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 4919EFE422AC27A200CD5A74 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4922F97022AAE53700967BB5 /* CollapseTableView */; + targetProxy = 4919EFE322AC27A200CD5A74 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 4919EFD122AC25D400CD5A74 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4919EFD222AC25D400CD5A74 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 4919EFD622AC25D500CD5A74 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4919EFD722AC25D500CD5A74 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ + 4919EFDA22AC25D500CD5A74 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = CollapseTableViewDemo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = sk.CollapseTableViewDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4919EFDB22AC25D500CD5A74 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = CollapseTableViewDemo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = sk.CollapseTableViewDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; 4922F97722AAE53700967BB5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -280,7 +462,6 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -307,7 +488,6 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -331,6 +511,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 4919EFDC22AC25D500CD5A74 /* Build configuration list for PBXNativeTarget "CollapseTableViewDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4919EFDA22AC25D500CD5A74 /* Debug */, + 4919EFDB22AC25D500CD5A74 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 4922F96B22AAE53700967BB5 /* Build configuration list for PBXProject "CollapseTableView" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/CollapseTableView.xcodeproj/xcuserdata/serhii_kharauzov.xcuserdatad/xcschemes/xcschememanagement.plist b/CollapseTableView.xcodeproj/xcuserdata/serhii_kharauzov.xcuserdatad/xcschemes/xcschememanagement.plist index e74acfa..b811c01 100644 --- a/CollapseTableView.xcodeproj/xcuserdata/serhii_kharauzov.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/CollapseTableView.xcodeproj/xcuserdata/serhii_kharauzov.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,6 +9,11 @@ orderHint 0 + CollapseTableViewDemo.xcscheme_^#shared#^_ + + orderHint + 1 + diff --git a/CollapseTableViewDemo/AppDelegate.swift b/CollapseTableViewDemo/AppDelegate.swift new file mode 100644 index 0000000..57b05a3 --- /dev/null +++ b/CollapseTableViewDemo/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// CollapseTableViewDemo +// +// Created by Serhii Kharauzov on 6/8/19. +// Copyright © 2019 Serhii Kharauzov. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/CollapseTableViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/CollapseTableViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/CollapseTableViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CollapseTableViewDemo/Assets.xcassets/Contents.json b/CollapseTableViewDemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/CollapseTableViewDemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CollapseTableViewDemo/Assets.xcassets/arrow_down.imageset/Contents.json b/CollapseTableViewDemo/Assets.xcassets/arrow_down.imageset/Contents.json new file mode 100644 index 0000000..3963f08 --- /dev/null +++ b/CollapseTableViewDemo/Assets.xcassets/arrow_down.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "arrow_down.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "preserves-vector-representation" : true + } +} \ No newline at end of file diff --git a/CollapseTableViewDemo/Assets.xcassets/arrow_down.imageset/arrow_down.pdf b/CollapseTableViewDemo/Assets.xcassets/arrow_down.imageset/arrow_down.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0319cf045dd0b6cb274fcf21e27a93fd313e688e GIT binary patch literal 4024 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 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CollapseTableViewDemo/Base.lproj/Main.storyboard b/CollapseTableViewDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..46bcd10 --- /dev/null +++ b/CollapseTableViewDemo/Base.lproj/Main.storyboard @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CollapseTableViewDemo/Info.plist b/CollapseTableViewDemo/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/CollapseTableViewDemo/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CollapseTableViewDemo/SectionHeaderView.swift b/CollapseTableViewDemo/SectionHeaderView.swift new file mode 100644 index 0000000..673eb63 --- /dev/null +++ b/CollapseTableViewDemo/SectionHeaderView.swift @@ -0,0 +1,19 @@ +// +// SectionHeaderView.swift +// CollapseTableView +// +// Created by Serhii Kharauzov on 6/7/19. +// Copyright © 2019 Serhii Kharauzov. All rights reserved. +// + +import UIKit +import CollapseTableView + +class SectionHeaderView: UIView, CollapseSectionHeader { + + @IBOutlet weak var imageView: UIImageView! + + var indicatorImageView: UIImageView { + return imageView + } +} diff --git a/CollapseTableViewDemo/SectionHeaderView.xib b/CollapseTableViewDemo/SectionHeaderView.xib new file mode 100644 index 0000000..676e111 --- /dev/null +++ b/CollapseTableViewDemo/SectionHeaderView.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CollapseTableViewDemo/ViewController.swift b/CollapseTableViewDemo/ViewController.swift new file mode 100644 index 0000000..8678273 --- /dev/null +++ b/CollapseTableViewDemo/ViewController.swift @@ -0,0 +1,61 @@ +// +// ViewController.swift +// CollapseTableView +// +// Created by Serhii Kharauzov on 6/6/19. +// Copyright © 2019 Serhii Kharauzov. All rights reserved. +// + +import UIKit +import CollapseTableView + +class ViewController: UIViewController { + + @IBOutlet weak var tableView: CollapseTableView! + + override func viewDidLoad() { + super.viewDidLoad() + tableView.delegate = self + tableView.dataSource = self + tableView.didTapSectionHeaderView = { (sectionIndex, isOpen) in + debugPrint("sectionIndex \(sectionIndex), isOpen \(isOpen)") + } + tableView.reloadData() + tableView.openSection(0, animated: true) + } +} + +extension ViewController: UITableViewDataSource, UITableViewDelegate { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 4 + } + + func numberOfSections(in tableView: UITableView) -> Int { + return 4 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "customCell", for: indexPath) + cell.textLabel?.text = "textLabel \(indexPath.row)" + cell.detailTextLabel?.text = "detailTextLabel \(indexPath.row)" + return cell + } + + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + let view = Bundle.main.loadNibNamed("SectionHeaderView", owner: self, options: nil)?.first as? SectionHeaderView + return view + } + + func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { + return 1 + } + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + return 60 + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 44 + } +} +