├── .DS_Store ├── Asset Setup ├── .DS_Store ├── bg │ ├── Conjuring.jpg │ ├── Guardians of the Galaxy.jpg │ ├── Insidious.jpeg │ ├── The Avengers.jpg │ ├── The Dark Knight.jpg │ ├── The Flash.jpg │ ├── The Incredibles.jpg │ ├── The Lion King.jpg │ └── The Walking Dead.jpg └── sections.rtf └── Complete Project ├── .DS_Store ├── TableViewDropDown.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── briefos.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── briefos.xcuserdatad │ └── xcschemes │ ├── TableViewDropDown.xcscheme │ └── xcschememanagement.plist └── TableViewDropDown ├── .DS_Store ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json └── bg │ ├── Conjuring.imageset │ ├── Conjuring.jpg │ └── Contents.json │ ├── Contents.json │ ├── Guardians of the Galaxy.imageset │ ├── Contents.json │ └── Guardians of the Galaxy.jpg │ ├── Insidious.imageset │ ├── Contents.json │ └── Insidious.jpeg │ ├── The Avengers.imageset │ ├── Contents.json │ └── The Avengers.jpg │ ├── The Dark Knight.imageset │ ├── Contents.json │ └── The Dark Knight.jpg │ ├── The Flash.imageset │ ├── Contents.json │ └── The Flash.jpg │ ├── The Incredibles.imageset │ ├── Contents.json │ └── The Incredibles.jpg │ ├── The Lion King.imageset │ ├── Contents.json │ └── The Lion King.jpg │ └── The Walking Dead.imageset │ ├── Contents.json │ └── The Walking Dead.jpg ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── ExpandableHeaderView.swift ├── Info.plist ├── Section.swift ├── SimpleVC.swift ├── SimpleVC.xib └── ViewController.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/.DS_Store -------------------------------------------------------------------------------- /Asset Setup/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/.DS_Store -------------------------------------------------------------------------------- /Asset Setup/bg/Conjuring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/Conjuring.jpg -------------------------------------------------------------------------------- /Asset Setup/bg/Guardians of the Galaxy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/Guardians of the Galaxy.jpg -------------------------------------------------------------------------------- /Asset Setup/bg/Insidious.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/Insidious.jpeg -------------------------------------------------------------------------------- /Asset Setup/bg/The Avengers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/The Avengers.jpg -------------------------------------------------------------------------------- /Asset Setup/bg/The Dark Knight.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/The Dark Knight.jpg -------------------------------------------------------------------------------- /Asset Setup/bg/The Flash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/The Flash.jpg -------------------------------------------------------------------------------- /Asset Setup/bg/The Incredibles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/The Incredibles.jpg -------------------------------------------------------------------------------- /Asset Setup/bg/The Lion King.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/The Lion King.jpg -------------------------------------------------------------------------------- /Asset Setup/bg/The Walking Dead.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Asset Setup/bg/The Walking Dead.jpg -------------------------------------------------------------------------------- /Asset Setup/sections.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf820 2 | {\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset0 AppleColorEmoji;} 3 | {\colortbl;\red255\green255\blue255;\red170\green13\blue145;\red0\green0\blue0;\red196\green26\blue22; 4 | } 5 | {\*\expandedcolortbl;;\csgenericrgb\c66500\c5200\c56900;\csgenericrgb\c0\c0\c0;\csgenericrgb\c77000\c10200\c8600; 6 | } 7 | \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 8 | \deftab543 9 | \pard\tx543\pardeftab543\pardirnatural\partightenfactor0 10 | 11 | \f0\fs22 \cf2 \CocoaLigature0 var\cf3 sections = [\ 12 | Section(genre: \cf4 " 13 | \f1 \uc0\u55358 \u56705 14 | \f0 Animation"\cf3 ,\ 15 | movies: [\cf4 "The Lion King"\cf3 , \cf4 "The Incredibles"\cf3 ],\ 16 | expanded: \cf2 false\cf3 ),\ 17 | Section(genre: \cf4 " 18 | \f1 \uc0\u55357 \u56485 19 | \f0 Superhero"\cf3 ,\ 20 | movies: [\cf4 "Guardians of the Galaxy"\cf3 , \cf4 "The Flash"\cf3 , \cf4 "The Avengers"\cf3 , \cf4 "The Dark Knight"\cf3 ],\ 21 | expanded: \cf2 false\cf3 ),\ 22 | Section(genre: \cf4 " 23 | \f1 \uc0\u55357 \u56443 24 | \f0 Horror"\cf3 ,\ 25 | movies: [\cf4 "The Walking Dead"\cf3 , \cf4 "Insidious"\cf3 , \cf4 "Conjuring"\cf3 ],\ 26 | expanded: \cf2 false\cf3 )\ 27 | ]} -------------------------------------------------------------------------------- /Complete Project/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/.DS_Store -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C9D8B61E1EBA7C4500FCDFBA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D8B61D1EBA7C4500FCDFBA /* AppDelegate.swift */; }; 11 | C9D8B6201EBA7C4500FCDFBA /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D8B61F1EBA7C4500FCDFBA /* ViewController.swift */; }; 12 | C9D8B6231EBA7C4500FCDFBA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9D8B6211EBA7C4500FCDFBA /* Main.storyboard */; }; 13 | C9D8B6251EBA7C4500FCDFBA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9D8B6241EBA7C4500FCDFBA /* Assets.xcassets */; }; 14 | C9D8B6281EBA7C4500FCDFBA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9D8B6261EBA7C4500FCDFBA /* LaunchScreen.storyboard */; }; 15 | C9D8B6341EBA7EB500FCDFBA /* Section.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D8B6331EBA7EB500FCDFBA /* Section.swift */; }; 16 | C9D8B6361EBA7F2000FCDFBA /* ExpandableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D8B6351EBA7F2000FCDFBA /* ExpandableHeaderView.swift */; }; 17 | C9D8B63A1EBA86CA00FCDFBA /* SimpleVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D8B6381EBA86CA00FCDFBA /* SimpleVC.swift */; }; 18 | C9D8B63B1EBA86CA00FCDFBA /* SimpleVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = C9D8B6391EBA86CA00FCDFBA /* SimpleVC.xib */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | C9D8B61A1EBA7C4500FCDFBA /* TableViewDropDown.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TableViewDropDown.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | C9D8B61D1EBA7C4500FCDFBA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 24 | C9D8B61F1EBA7C4500FCDFBA /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 25 | C9D8B6221EBA7C4500FCDFBA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | C9D8B6241EBA7C4500FCDFBA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | C9D8B6271EBA7C4500FCDFBA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | C9D8B6291EBA7C4500FCDFBA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | C9D8B6331EBA7EB500FCDFBA /* Section.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Section.swift; sourceTree = ""; }; 30 | C9D8B6351EBA7F2000FCDFBA /* ExpandableHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExpandableHeaderView.swift; sourceTree = ""; }; 31 | C9D8B6381EBA86CA00FCDFBA /* SimpleVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleVC.swift; sourceTree = ""; }; 32 | C9D8B6391EBA86CA00FCDFBA /* SimpleVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SimpleVC.xib; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | C9D8B6171EBA7C4500FCDFBA /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | C9D8B6111EBA7C4500FCDFBA = { 47 | isa = PBXGroup; 48 | children = ( 49 | C9D8B61C1EBA7C4500FCDFBA /* TableViewDropDown */, 50 | C9D8B61B1EBA7C4500FCDFBA /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | C9D8B61B1EBA7C4500FCDFBA /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | C9D8B61A1EBA7C4500FCDFBA /* TableViewDropDown.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | C9D8B61C1EBA7C4500FCDFBA /* TableViewDropDown */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | C9D8B6371EBA86B300FCDFBA /* SimpleVC */, 66 | C9D8B6321EBA7E9700FCDFBA /* ExpandableHeaderView */, 67 | C9D8B61D1EBA7C4500FCDFBA /* AppDelegate.swift */, 68 | C9D8B61F1EBA7C4500FCDFBA /* ViewController.swift */, 69 | C9D8B6211EBA7C4500FCDFBA /* Main.storyboard */, 70 | C9D8B6241EBA7C4500FCDFBA /* Assets.xcassets */, 71 | C9D8B6261EBA7C4500FCDFBA /* LaunchScreen.storyboard */, 72 | C9D8B6291EBA7C4500FCDFBA /* Info.plist */, 73 | ); 74 | path = TableViewDropDown; 75 | sourceTree = ""; 76 | }; 77 | C9D8B6321EBA7E9700FCDFBA /* ExpandableHeaderView */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | C9D8B6331EBA7EB500FCDFBA /* Section.swift */, 81 | C9D8B6351EBA7F2000FCDFBA /* ExpandableHeaderView.swift */, 82 | ); 83 | name = ExpandableHeaderView; 84 | sourceTree = ""; 85 | }; 86 | C9D8B6371EBA86B300FCDFBA /* SimpleVC */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | C9D8B6381EBA86CA00FCDFBA /* SimpleVC.swift */, 90 | C9D8B6391EBA86CA00FCDFBA /* SimpleVC.xib */, 91 | ); 92 | name = SimpleVC; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | C9D8B6191EBA7C4500FCDFBA /* TableViewDropDown */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = C9D8B62C1EBA7C4500FCDFBA /* Build configuration list for PBXNativeTarget "TableViewDropDown" */; 101 | buildPhases = ( 102 | C9D8B6161EBA7C4500FCDFBA /* Sources */, 103 | C9D8B6171EBA7C4500FCDFBA /* Frameworks */, 104 | C9D8B6181EBA7C4500FCDFBA /* Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = TableViewDropDown; 111 | productName = TableViewDropDown; 112 | productReference = C9D8B61A1EBA7C4500FCDFBA /* TableViewDropDown.app */; 113 | productType = "com.apple.product-type.application"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | C9D8B6121EBA7C4500FCDFBA /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastSwiftUpdateCheck = 0830; 122 | LastUpgradeCheck = 0830; 123 | ORGANIZATIONNAME = BriefOS; 124 | TargetAttributes = { 125 | C9D8B6191EBA7C4500FCDFBA = { 126 | CreatedOnToolsVersion = 8.3.2; 127 | ProvisioningStyle = Automatic; 128 | }; 129 | }; 130 | }; 131 | buildConfigurationList = C9D8B6151EBA7C4500FCDFBA /* Build configuration list for PBXProject "TableViewDropDown" */; 132 | compatibilityVersion = "Xcode 3.2"; 133 | developmentRegion = English; 134 | hasScannedForEncodings = 0; 135 | knownRegions = ( 136 | en, 137 | Base, 138 | ); 139 | mainGroup = C9D8B6111EBA7C4500FCDFBA; 140 | productRefGroup = C9D8B61B1EBA7C4500FCDFBA /* Products */; 141 | projectDirPath = ""; 142 | projectRoot = ""; 143 | targets = ( 144 | C9D8B6191EBA7C4500FCDFBA /* TableViewDropDown */, 145 | ); 146 | }; 147 | /* End PBXProject section */ 148 | 149 | /* Begin PBXResourcesBuildPhase section */ 150 | C9D8B6181EBA7C4500FCDFBA /* Resources */ = { 151 | isa = PBXResourcesBuildPhase; 152 | buildActionMask = 2147483647; 153 | files = ( 154 | C9D8B63B1EBA86CA00FCDFBA /* SimpleVC.xib in Resources */, 155 | C9D8B6281EBA7C4500FCDFBA /* LaunchScreen.storyboard in Resources */, 156 | C9D8B6251EBA7C4500FCDFBA /* Assets.xcassets in Resources */, 157 | C9D8B6231EBA7C4500FCDFBA /* Main.storyboard in Resources */, 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | /* End PBXResourcesBuildPhase section */ 162 | 163 | /* Begin PBXSourcesBuildPhase section */ 164 | C9D8B6161EBA7C4500FCDFBA /* Sources */ = { 165 | isa = PBXSourcesBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | C9D8B6341EBA7EB500FCDFBA /* Section.swift in Sources */, 169 | C9D8B6361EBA7F2000FCDFBA /* ExpandableHeaderView.swift in Sources */, 170 | C9D8B6201EBA7C4500FCDFBA /* ViewController.swift in Sources */, 171 | C9D8B63A1EBA86CA00FCDFBA /* SimpleVC.swift in Sources */, 172 | C9D8B61E1EBA7C4500FCDFBA /* AppDelegate.swift in Sources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXSourcesBuildPhase section */ 177 | 178 | /* Begin PBXVariantGroup section */ 179 | C9D8B6211EBA7C4500FCDFBA /* Main.storyboard */ = { 180 | isa = PBXVariantGroup; 181 | children = ( 182 | C9D8B6221EBA7C4500FCDFBA /* Base */, 183 | ); 184 | name = Main.storyboard; 185 | sourceTree = ""; 186 | }; 187 | C9D8B6261EBA7C4500FCDFBA /* LaunchScreen.storyboard */ = { 188 | isa = PBXVariantGroup; 189 | children = ( 190 | C9D8B6271EBA7C4500FCDFBA /* Base */, 191 | ); 192 | name = LaunchScreen.storyboard; 193 | sourceTree = ""; 194 | }; 195 | /* End PBXVariantGroup section */ 196 | 197 | /* Begin XCBuildConfiguration section */ 198 | C9D8B62A1EBA7C4500FCDFBA /* Debug */ = { 199 | isa = XCBuildConfiguration; 200 | buildSettings = { 201 | ALWAYS_SEARCH_USER_PATHS = NO; 202 | CLANG_ANALYZER_NONNULL = YES; 203 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 204 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 205 | CLANG_CXX_LIBRARY = "libc++"; 206 | CLANG_ENABLE_MODULES = YES; 207 | CLANG_ENABLE_OBJC_ARC = YES; 208 | CLANG_WARN_BOOL_CONVERSION = YES; 209 | CLANG_WARN_CONSTANT_CONVERSION = YES; 210 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 211 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 212 | CLANG_WARN_EMPTY_BODY = YES; 213 | CLANG_WARN_ENUM_CONVERSION = YES; 214 | CLANG_WARN_INFINITE_RECURSION = YES; 215 | CLANG_WARN_INT_CONVERSION = YES; 216 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 217 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 218 | CLANG_WARN_UNREACHABLE_CODE = YES; 219 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 220 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 221 | COPY_PHASE_STRIP = NO; 222 | DEBUG_INFORMATION_FORMAT = dwarf; 223 | ENABLE_STRICT_OBJC_MSGSEND = YES; 224 | ENABLE_TESTABILITY = YES; 225 | GCC_C_LANGUAGE_STANDARD = gnu99; 226 | GCC_DYNAMIC_NO_PIC = NO; 227 | GCC_NO_COMMON_BLOCKS = YES; 228 | GCC_OPTIMIZATION_LEVEL = 0; 229 | GCC_PREPROCESSOR_DEFINITIONS = ( 230 | "DEBUG=1", 231 | "$(inherited)", 232 | ); 233 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 234 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 235 | GCC_WARN_UNDECLARED_SELECTOR = YES; 236 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 237 | GCC_WARN_UNUSED_FUNCTION = YES; 238 | GCC_WARN_UNUSED_VARIABLE = YES; 239 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 240 | MTL_ENABLE_DEBUG_INFO = YES; 241 | ONLY_ACTIVE_ARCH = YES; 242 | SDKROOT = iphoneos; 243 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 244 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 245 | TARGETED_DEVICE_FAMILY = "1,2"; 246 | }; 247 | name = Debug; 248 | }; 249 | C9D8B62B1EBA7C4500FCDFBA /* Release */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | ALWAYS_SEARCH_USER_PATHS = NO; 253 | CLANG_ANALYZER_NONNULL = YES; 254 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 255 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 256 | CLANG_CXX_LIBRARY = "libc++"; 257 | CLANG_ENABLE_MODULES = YES; 258 | CLANG_ENABLE_OBJC_ARC = YES; 259 | CLANG_WARN_BOOL_CONVERSION = YES; 260 | CLANG_WARN_CONSTANT_CONVERSION = YES; 261 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 262 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 263 | CLANG_WARN_EMPTY_BODY = YES; 264 | CLANG_WARN_ENUM_CONVERSION = YES; 265 | CLANG_WARN_INFINITE_RECURSION = YES; 266 | CLANG_WARN_INT_CONVERSION = YES; 267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 268 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 272 | COPY_PHASE_STRIP = NO; 273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 274 | ENABLE_NS_ASSERTIONS = NO; 275 | ENABLE_STRICT_OBJC_MSGSEND = YES; 276 | GCC_C_LANGUAGE_STANDARD = gnu99; 277 | GCC_NO_COMMON_BLOCKS = YES; 278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 280 | GCC_WARN_UNDECLARED_SELECTOR = YES; 281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 282 | GCC_WARN_UNUSED_FUNCTION = YES; 283 | GCC_WARN_UNUSED_VARIABLE = YES; 284 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 285 | MTL_ENABLE_DEBUG_INFO = NO; 286 | SDKROOT = iphoneos; 287 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 288 | TARGETED_DEVICE_FAMILY = "1,2"; 289 | VALIDATE_PRODUCT = YES; 290 | }; 291 | name = Release; 292 | }; 293 | C9D8B62D1EBA7C4500FCDFBA /* Debug */ = { 294 | isa = XCBuildConfiguration; 295 | buildSettings = { 296 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 297 | INFOPLIST_FILE = TableViewDropDown/Info.plist; 298 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 299 | PRODUCT_BUNDLE_IDENTIFIER = com.briefos.TableViewDropDown; 300 | PRODUCT_NAME = "$(TARGET_NAME)"; 301 | SWIFT_VERSION = 3.0; 302 | }; 303 | name = Debug; 304 | }; 305 | C9D8B62E1EBA7C4500FCDFBA /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 309 | INFOPLIST_FILE = TableViewDropDown/Info.plist; 310 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 311 | PRODUCT_BUNDLE_IDENTIFIER = com.briefos.TableViewDropDown; 312 | PRODUCT_NAME = "$(TARGET_NAME)"; 313 | SWIFT_VERSION = 3.0; 314 | }; 315 | name = Release; 316 | }; 317 | /* End XCBuildConfiguration section */ 318 | 319 | /* Begin XCConfigurationList section */ 320 | C9D8B6151EBA7C4500FCDFBA /* Build configuration list for PBXProject "TableViewDropDown" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | C9D8B62A1EBA7C4500FCDFBA /* Debug */, 324 | C9D8B62B1EBA7C4500FCDFBA /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | C9D8B62C1EBA7C4500FCDFBA /* Build configuration list for PBXNativeTarget "TableViewDropDown" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | C9D8B62D1EBA7C4500FCDFBA /* Debug */, 333 | C9D8B62E1EBA7C4500FCDFBA /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | }; 337 | /* End XCConfigurationList section */ 338 | }; 339 | rootObject = C9D8B6121EBA7C4500FCDFBA /* Project object */; 340 | } 341 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown.xcodeproj/project.xcworkspace/xcuserdata/briefos.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown.xcodeproj/project.xcworkspace/xcuserdata/briefos.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown.xcodeproj/xcuserdata/briefos.xcuserdatad/xcschemes/TableViewDropDown.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown.xcodeproj/xcuserdata/briefos.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TableViewDropDown.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C9D8B6191EBA7C4500FCDFBA 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/.DS_Store -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // TableViewDropDown 4 | // 5 | // Created by BriefOS on 5/3/17. 6 | // Copyright © 2017 BriefOS. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/Conjuring.imageset/Conjuring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/Conjuring.imageset/Conjuring.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/Conjuring.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Conjuring.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/Guardians of the Galaxy.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Guardians of the Galaxy.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/Guardians of the Galaxy.imageset/Guardians of the Galaxy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/Guardians of the Galaxy.imageset/Guardians of the Galaxy.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/Insidious.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Insidious.jpeg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/Insidious.imageset/Insidious.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/Insidious.imageset/Insidious.jpeg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Avengers.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "The Avengers.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Avengers.imageset/The Avengers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/The Avengers.imageset/The Avengers.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Dark Knight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "The Dark Knight.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Dark Knight.imageset/The Dark Knight.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/The Dark Knight.imageset/The Dark Knight.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Flash.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "The Flash.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Flash.imageset/The Flash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/The Flash.imageset/The Flash.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Incredibles.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "The Incredibles.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Incredibles.imageset/The Incredibles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/The Incredibles.imageset/The Incredibles.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Lion King.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "The Lion King.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Lion King.imageset/The Lion King.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/The Lion King.imageset/The Lion King.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Walking Dead.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "The Walking Dead.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Assets.xcassets/bg/The Walking Dead.imageset/The Walking Dead.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briefos/TableViewDropDown/af97bd43c15dc0de207d9dacb17cd1d474fdefab/Complete Project/TableViewDropDown/Assets.xcassets/bg/The Walking Dead.imageset/The Walking Dead.jpg -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/ExpandableHeaderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableHeaderView.swift 3 | // TableViewDropDown 4 | // 5 | // Created by BriefOS on 5/3/17. 6 | // Copyright © 2017 BriefOS. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol ExpandableHeaderViewDelegate { 12 | func toggleSection(header: ExpandableHeaderView, section: Int) 13 | } 14 | 15 | class ExpandableHeaderView: UITableViewHeaderFooterView { 16 | var delegate: ExpandableHeaderViewDelegate? 17 | var section: Int! 18 | 19 | override init(reuseIdentifier: String?) { 20 | super.init(reuseIdentifier: reuseIdentifier) 21 | self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(selectHeaderAction))) 22 | } 23 | 24 | required init?(coder aDecoder: NSCoder) { 25 | fatalError("init(coder:) has not been implemented") 26 | } 27 | 28 | func selectHeaderAction(gestureRecognizer: UITapGestureRecognizer) { 29 | let cell = gestureRecognizer.view as! ExpandableHeaderView 30 | delegate?.toggleSection(header: self, section: cell.section) 31 | } 32 | 33 | func customInit(title: String, section: Int, delegate: ExpandableHeaderViewDelegate) { 34 | self.textLabel?.text = title 35 | self.section = section 36 | self.delegate = delegate 37 | } 38 | 39 | override func layoutSubviews() { 40 | super.layoutSubviews() 41 | self.textLabel?.textColor = UIColor.white 42 | self.contentView.backgroundColor = UIColor.darkGray 43 | } 44 | 45 | /* 46 | // Only override draw() if you perform custom drawing. 47 | // An empty implementation adversely affects performance during animation. 48 | override func draw(_ rect: CGRect) { 49 | // Drawing code 50 | } 51 | */ 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/Section.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Section.swift 3 | // TableViewDropDown 4 | // 5 | // Created by BriefOS on 5/3/17. 6 | // Copyright © 2017 BriefOS. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct Section { 12 | var genre: String! 13 | var movies: [String]! 14 | var expanded: Bool! 15 | 16 | init(genre: String, movies: [String], expanded: Bool) { 17 | self.genre = genre 18 | self.movies = movies 19 | self.expanded = expanded 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/SimpleVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleVC.swift 3 | // TableViewDropDown 4 | // 5 | // Created by BriefOS on 5/3/17. 6 | // Copyright © 2017 BriefOS. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SimpleVC: UIViewController { 12 | 13 | @IBOutlet weak var movieImage: UIImageView! 14 | var imageName: String! 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | // Do any additional setup after loading the view. 20 | 21 | self.movieImage.image = UIImage(named: imageName) 22 | self.title = imageName 23 | } 24 | 25 | func customInit(imageName: String) { 26 | self.imageName = imageName 27 | } 28 | 29 | override func didReceiveMemoryWarning() { 30 | super.didReceiveMemoryWarning() 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | 35 | /* 36 | // MARK: - Navigation 37 | 38 | // In a storyboard-based application, you will often want to do a little preparation before navigation 39 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 40 | // Get the new view controller using segue.destinationViewController. 41 | // Pass the selected object to the new view controller. 42 | } 43 | */ 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/SimpleVC.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Complete Project/TableViewDropDown/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // TableViewDropDown 4 | // 5 | // Created by BriefOS on 5/3/17. 6 | // Copyright © 2017 BriefOS. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, ExpandableHeaderViewDelegate { 12 | 13 | @IBOutlet weak var tableView: UITableView! 14 | 15 | var sections = [ 16 | Section(genre: "🦁 Animation", 17 | movies: ["The Lion King", "The Incredibles"], 18 | expanded: false), 19 | Section(genre: "💥 Superhero", 20 | movies: ["Guardians of the Galaxy", "The Flash", "The Avengers", "The Dark Knight"], 21 | expanded: false), 22 | Section(genre: "👻 Horror", 23 | movies: ["The Walking Dead", "Insidious", "Conjuring"], 24 | expanded: false) 25 | ] 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | // Do any additional setup after loading the view, typically from a nib. 30 | } 31 | 32 | override func didReceiveMemoryWarning() { 33 | super.didReceiveMemoryWarning() 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | func numberOfSections(in tableView: UITableView) -> Int { 38 | return sections.count 39 | } 40 | 41 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 42 | return sections[section].movies.count 43 | } 44 | 45 | func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { 46 | return 44 47 | } 48 | 49 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 50 | if (sections[indexPath.section].expanded) { 51 | return 44 52 | } else { 53 | return 0 54 | } 55 | } 56 | 57 | func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { 58 | return 2 59 | } 60 | 61 | func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { 62 | let header = ExpandableHeaderView() 63 | header.customInit(title: sections[section].genre, section: section, delegate: self) 64 | return header 65 | } 66 | 67 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 68 | let cell = tableView.dequeueReusableCell(withIdentifier: "labelCell")! 69 | cell.textLabel?.text = sections[indexPath.section].movies[indexPath.row] 70 | return cell 71 | } 72 | 73 | func toggleSection(header: ExpandableHeaderView, section: Int) { 74 | sections[section].expanded = !sections[section].expanded 75 | 76 | 77 | tableView.beginUpdates() 78 | for i in 0 ..< sections[section].movies.count { 79 | tableView.reloadRows(at: [IndexPath(row: i, section: section)], with: .automatic) 80 | } 81 | tableView.endUpdates() 82 | } 83 | 84 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 85 | let simpleVC = SimpleVC() 86 | simpleVC.customInit(imageName: sections[indexPath.section].movies[indexPath.row]) 87 | tableView.deselectRow(at: indexPath, animated: true) 88 | self.navigationController?.pushViewController(simpleVC, animated: true) 89 | } 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | } 114 | 115 | --------------------------------------------------------------------------------