├── LICENSE ├── README.md ├── Simulator Screen Shot Aug 16, 2017, 10.04.22 PM.png └── VBExpand_Tableview ├── VBExpand_Tableview.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Vimal.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Vimal.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── VBExpand_Tableview.xcscheme │ └── xcschememanagement.plist └── VBExpand_Tableview ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json ├── ExpandDownArrow.imageset │ ├── Contents.json │ ├── ExpandDownArrow.png │ ├── ExpandDownArrow@2x.png │ └── ExpandDownArrow@3x.png └── ExpandUpArrow.imageset │ ├── Contents.json │ ├── ExpandupArrow.png │ ├── ExpandupArrow@2x.png │ └── ExpandupArrow@3x.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── VBExpandVC.swift ├── VBHeader.swift ├── VBHeader.xib └── VCExpandCell.swift /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 vimalbosamia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VBExpandTableview -------------------------------------------------------------------------------- /Simulator Screen Shot Aug 16, 2017, 10.04.22 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/Simulator Screen Shot Aug 16, 2017, 10.04.22 PM.png -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 94D5F69A1F44681B00EF8804 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D5F6991F44681B00EF8804 /* AppDelegate.swift */; }; 11 | 94D5F69F1F44681C00EF8804 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94D5F69D1F44681C00EF8804 /* Main.storyboard */; }; 12 | 94D5F6A11F44681D00EF8804 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 94D5F6A01F44681D00EF8804 /* Assets.xcassets */; }; 13 | 94D5F6A41F44681D00EF8804 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94D5F6A21F44681D00EF8804 /* LaunchScreen.storyboard */; }; 14 | 94D5F6AD1F44687900EF8804 /* VBHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D5F6AB1F44687900EF8804 /* VBHeader.swift */; }; 15 | 94D5F6AE1F44687900EF8804 /* VBHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 94D5F6AC1F44687900EF8804 /* VBHeader.xib */; }; 16 | 94D5F6B01F446A5B00EF8804 /* VBExpandVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D5F6AF1F446A5B00EF8804 /* VBExpandVC.swift */; }; 17 | 94D5F6B21F446A8000EF8804 /* VCExpandCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94D5F6B11F446A8000EF8804 /* VCExpandCell.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 94D5F6961F44681B00EF8804 /* VBExpand_Tableview.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VBExpand_Tableview.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 94D5F6991F44681B00EF8804 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 23 | 94D5F69E1F44681C00EF8804 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | 94D5F6A01F44681D00EF8804 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 94D5F6A31F44681D00EF8804 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | 94D5F6A51F44681D00EF8804 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | 94D5F6AB1F44687900EF8804 /* VBHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VBHeader.swift; sourceTree = ""; }; 28 | 94D5F6AC1F44687900EF8804 /* VBHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VBHeader.xib; sourceTree = ""; }; 29 | 94D5F6AF1F446A5B00EF8804 /* VBExpandVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VBExpandVC.swift; sourceTree = ""; }; 30 | 94D5F6B11F446A8000EF8804 /* VCExpandCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VCExpandCell.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 94D5F6931F44681B00EF8804 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 94D5F68D1F44681B00EF8804 = { 45 | isa = PBXGroup; 46 | children = ( 47 | 94D5F6981F44681B00EF8804 /* VBExpand_Tableview */, 48 | 94D5F6971F44681B00EF8804 /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | 94D5F6971F44681B00EF8804 /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 94D5F6961F44681B00EF8804 /* VBExpand_Tableview.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | 94D5F6981F44681B00EF8804 /* VBExpand_Tableview */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 94D5F6991F44681B00EF8804 /* AppDelegate.swift */, 64 | 94D5F69D1F44681C00EF8804 /* Main.storyboard */, 65 | 94D5F6A01F44681D00EF8804 /* Assets.xcassets */, 66 | 94D5F6A21F44681D00EF8804 /* LaunchScreen.storyboard */, 67 | 94D5F6A51F44681D00EF8804 /* Info.plist */, 68 | 94D5F6AB1F44687900EF8804 /* VBHeader.swift */, 69 | 94D5F6AC1F44687900EF8804 /* VBHeader.xib */, 70 | 94D5F6AF1F446A5B00EF8804 /* VBExpandVC.swift */, 71 | 94D5F6B11F446A8000EF8804 /* VCExpandCell.swift */, 72 | ); 73 | path = VBExpand_Tableview; 74 | sourceTree = ""; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | 94D5F6951F44681B00EF8804 /* VBExpand_Tableview */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = 94D5F6A81F44681D00EF8804 /* Build configuration list for PBXNativeTarget "VBExpand_Tableview" */; 82 | buildPhases = ( 83 | 94D5F6921F44681B00EF8804 /* Sources */, 84 | 94D5F6931F44681B00EF8804 /* Frameworks */, 85 | 94D5F6941F44681B00EF8804 /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = VBExpand_Tableview; 92 | productName = VBExpand_Tableview; 93 | productReference = 94D5F6961F44681B00EF8804 /* VBExpand_Tableview.app */; 94 | productType = "com.apple.product-type.application"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | 94D5F68E1F44681B00EF8804 /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastSwiftUpdateCheck = 0820; 103 | LastUpgradeCheck = 0820; 104 | ORGANIZATIONNAME = Crypton; 105 | TargetAttributes = { 106 | 94D5F6951F44681B00EF8804 = { 107 | CreatedOnToolsVersion = 8.2.1; 108 | ProvisioningStyle = Automatic; 109 | }; 110 | }; 111 | }; 112 | buildConfigurationList = 94D5F6911F44681B00EF8804 /* Build configuration list for PBXProject "VBExpand_Tableview" */; 113 | compatibilityVersion = "Xcode 3.2"; 114 | developmentRegion = English; 115 | hasScannedForEncodings = 0; 116 | knownRegions = ( 117 | en, 118 | Base, 119 | ); 120 | mainGroup = 94D5F68D1F44681B00EF8804; 121 | productRefGroup = 94D5F6971F44681B00EF8804 /* Products */; 122 | projectDirPath = ""; 123 | projectRoot = ""; 124 | targets = ( 125 | 94D5F6951F44681B00EF8804 /* VBExpand_Tableview */, 126 | ); 127 | }; 128 | /* End PBXProject section */ 129 | 130 | /* Begin PBXResourcesBuildPhase section */ 131 | 94D5F6941F44681B00EF8804 /* Resources */ = { 132 | isa = PBXResourcesBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | 94D5F6A41F44681D00EF8804 /* LaunchScreen.storyboard in Resources */, 136 | 94D5F6A11F44681D00EF8804 /* Assets.xcassets in Resources */, 137 | 94D5F6AE1F44687900EF8804 /* VBHeader.xib in Resources */, 138 | 94D5F69F1F44681C00EF8804 /* Main.storyboard in Resources */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXResourcesBuildPhase section */ 143 | 144 | /* Begin PBXSourcesBuildPhase section */ 145 | 94D5F6921F44681B00EF8804 /* Sources */ = { 146 | isa = PBXSourcesBuildPhase; 147 | buildActionMask = 2147483647; 148 | files = ( 149 | 94D5F6B01F446A5B00EF8804 /* VBExpandVC.swift in Sources */, 150 | 94D5F6AD1F44687900EF8804 /* VBHeader.swift in Sources */, 151 | 94D5F6B21F446A8000EF8804 /* VCExpandCell.swift in Sources */, 152 | 94D5F69A1F44681B00EF8804 /* AppDelegate.swift in Sources */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXSourcesBuildPhase section */ 157 | 158 | /* Begin PBXVariantGroup section */ 159 | 94D5F69D1F44681C00EF8804 /* Main.storyboard */ = { 160 | isa = PBXVariantGroup; 161 | children = ( 162 | 94D5F69E1F44681C00EF8804 /* Base */, 163 | ); 164 | name = Main.storyboard; 165 | sourceTree = ""; 166 | }; 167 | 94D5F6A21F44681D00EF8804 /* LaunchScreen.storyboard */ = { 168 | isa = PBXVariantGroup; 169 | children = ( 170 | 94D5F6A31F44681D00EF8804 /* Base */, 171 | ); 172 | name = LaunchScreen.storyboard; 173 | sourceTree = ""; 174 | }; 175 | /* End PBXVariantGroup section */ 176 | 177 | /* Begin XCBuildConfiguration section */ 178 | 94D5F6A61F44681D00EF8804 /* Debug */ = { 179 | isa = XCBuildConfiguration; 180 | buildSettings = { 181 | ALWAYS_SEARCH_USER_PATHS = NO; 182 | CLANG_ANALYZER_NONNULL = YES; 183 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 184 | CLANG_CXX_LIBRARY = "libc++"; 185 | CLANG_ENABLE_MODULES = YES; 186 | CLANG_ENABLE_OBJC_ARC = YES; 187 | CLANG_WARN_BOOL_CONVERSION = YES; 188 | CLANG_WARN_CONSTANT_CONVERSION = YES; 189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 190 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INFINITE_RECURSION = YES; 194 | CLANG_WARN_INT_CONVERSION = YES; 195 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 196 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 197 | CLANG_WARN_UNREACHABLE_CODE = YES; 198 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 199 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 200 | COPY_PHASE_STRIP = NO; 201 | DEBUG_INFORMATION_FORMAT = dwarf; 202 | ENABLE_STRICT_OBJC_MSGSEND = YES; 203 | ENABLE_TESTABILITY = YES; 204 | GCC_C_LANGUAGE_STANDARD = gnu99; 205 | GCC_DYNAMIC_NO_PIC = NO; 206 | GCC_NO_COMMON_BLOCKS = YES; 207 | GCC_OPTIMIZATION_LEVEL = 0; 208 | GCC_PREPROCESSOR_DEFINITIONS = ( 209 | "DEBUG=1", 210 | "$(inherited)", 211 | ); 212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 214 | GCC_WARN_UNDECLARED_SELECTOR = YES; 215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 216 | GCC_WARN_UNUSED_FUNCTION = YES; 217 | GCC_WARN_UNUSED_VARIABLE = YES; 218 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 219 | MTL_ENABLE_DEBUG_INFO = YES; 220 | ONLY_ACTIVE_ARCH = YES; 221 | SDKROOT = iphoneos; 222 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 223 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 224 | }; 225 | name = Debug; 226 | }; 227 | 94D5F6A71F44681D00EF8804 /* Release */ = { 228 | isa = XCBuildConfiguration; 229 | buildSettings = { 230 | ALWAYS_SEARCH_USER_PATHS = NO; 231 | CLANG_ANALYZER_NONNULL = YES; 232 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 233 | CLANG_CXX_LIBRARY = "libc++"; 234 | CLANG_ENABLE_MODULES = YES; 235 | CLANG_ENABLE_OBJC_ARC = YES; 236 | CLANG_WARN_BOOL_CONVERSION = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 239 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 240 | CLANG_WARN_EMPTY_BODY = YES; 241 | CLANG_WARN_ENUM_CONVERSION = YES; 242 | CLANG_WARN_INFINITE_RECURSION = YES; 243 | CLANG_WARN_INT_CONVERSION = YES; 244 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 245 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 246 | CLANG_WARN_UNREACHABLE_CODE = YES; 247 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 248 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 249 | COPY_PHASE_STRIP = NO; 250 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 251 | ENABLE_NS_ASSERTIONS = NO; 252 | ENABLE_STRICT_OBJC_MSGSEND = YES; 253 | GCC_C_LANGUAGE_STANDARD = gnu99; 254 | GCC_NO_COMMON_BLOCKS = YES; 255 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 256 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 257 | GCC_WARN_UNDECLARED_SELECTOR = YES; 258 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 259 | GCC_WARN_UNUSED_FUNCTION = YES; 260 | GCC_WARN_UNUSED_VARIABLE = YES; 261 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 262 | MTL_ENABLE_DEBUG_INFO = NO; 263 | SDKROOT = iphoneos; 264 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 265 | VALIDATE_PRODUCT = YES; 266 | }; 267 | name = Release; 268 | }; 269 | 94D5F6A91F44681D00EF8804 /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 273 | INFOPLIST_FILE = VBExpand_Tableview/Info.plist; 274 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 275 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 276 | PRODUCT_BUNDLE_IDENTIFIER = "com.VBExpand-Tableview"; 277 | PRODUCT_NAME = "$(TARGET_NAME)"; 278 | SWIFT_VERSION = 3.0; 279 | TARGETED_DEVICE_FAMILY = 1; 280 | }; 281 | name = Debug; 282 | }; 283 | 94D5F6AA1F44681D00EF8804 /* Release */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 287 | INFOPLIST_FILE = VBExpand_Tableview/Info.plist; 288 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 289 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 290 | PRODUCT_BUNDLE_IDENTIFIER = "com.VBExpand-Tableview"; 291 | PRODUCT_NAME = "$(TARGET_NAME)"; 292 | SWIFT_VERSION = 3.0; 293 | TARGETED_DEVICE_FAMILY = 1; 294 | }; 295 | name = Release; 296 | }; 297 | /* End XCBuildConfiguration section */ 298 | 299 | /* Begin XCConfigurationList section */ 300 | 94D5F6911F44681B00EF8804 /* Build configuration list for PBXProject "VBExpand_Tableview" */ = { 301 | isa = XCConfigurationList; 302 | buildConfigurations = ( 303 | 94D5F6A61F44681D00EF8804 /* Debug */, 304 | 94D5F6A71F44681D00EF8804 /* Release */, 305 | ); 306 | defaultConfigurationIsVisible = 0; 307 | defaultConfigurationName = Release; 308 | }; 309 | 94D5F6A81F44681D00EF8804 /* Build configuration list for PBXNativeTarget "VBExpand_Tableview" */ = { 310 | isa = XCConfigurationList; 311 | buildConfigurations = ( 312 | 94D5F6A91F44681D00EF8804 /* Debug */, 313 | 94D5F6AA1F44681D00EF8804 /* Release */, 314 | ); 315 | defaultConfigurationIsVisible = 0; 316 | }; 317 | /* End XCConfigurationList section */ 318 | }; 319 | rootObject = 94D5F68E1F44681B00EF8804 /* Project object */; 320 | } 321 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview.xcodeproj/project.xcworkspace/xcuserdata/Vimal.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/VBExpand_Tableview/VBExpand_Tableview.xcodeproj/project.xcworkspace/xcuserdata/Vimal.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview.xcodeproj/xcuserdata/Vimal.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview.xcodeproj/xcuserdata/Vimal.xcuserdatad/xcschemes/VBExpand_Tableview.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 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview.xcodeproj/xcuserdata/Vimal.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | VBExpand_Tableview.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 94D5F6951F44681B00EF8804 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // VBExpand_Tableview 4 | // 5 | // Created by Vimal on 8/16/17. 6 | // Copyright © 2017 Crypton. 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 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandDownArrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ExpandDownArrow.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ExpandDownArrow@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ExpandDownArrow@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandDownArrow.imageset/ExpandDownArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandDownArrow.imageset/ExpandDownArrow.png -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandDownArrow.imageset/ExpandDownArrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandDownArrow.imageset/ExpandDownArrow@2x.png -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandDownArrow.imageset/ExpandDownArrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandDownArrow.imageset/ExpandDownArrow@3x.png -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandUpArrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ExpandupArrow.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ExpandupArrow@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ExpandupArrow@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandUpArrow.imageset/ExpandupArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandUpArrow.imageset/ExpandupArrow.png -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandUpArrow.imageset/ExpandupArrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandUpArrow.imageset/ExpandupArrow@2x.png -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandUpArrow.imageset/ExpandupArrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimalbosamia/VBExpandTableview/75a4b6947fb65a133bdb05849d8fe81923aac1a3/VBExpand_Tableview/VBExpand_Tableview/Assets.xcassets/ExpandUpArrow.imageset/ExpandupArrow@3x.png -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/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 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/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 | 44 | 45 | 46 | 53 | 60 | 67 | 74 | 81 | 88 | 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 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/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 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/VBExpandVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VBExpandVC.swift 3 | // VBExpand_Tableview 4 | // 5 | // Created by Vimal on 8/16/17. 6 | // Copyright © 2017 Crypton. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class VBExpandVC: UIViewController,UITableViewDelegate,UITableViewDataSource { 12 | 13 | @IBOutlet var myTableView: UITableView! 14 | var expandTableview:VBHeader = VBHeader() 15 | var cell : VCExpandCell! 16 | var arrStatus:NSMutableArray = [] 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | for i in 0..<10 // pass your array count 21 | { 22 | self.arrStatus.add("0") 23 | } 24 | 25 | self.myTableView?.reloadData() 26 | // Do any additional setup after loading the view. 27 | } 28 | 29 | override func didReceiveMemoryWarning() { 30 | super.didReceiveMemoryWarning() 31 | // Dispose of any resources that can be recreated. 32 | } 33 | func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? 34 | { 35 | expandTableview = Bundle.main.loadNibNamed("VBHeader", owner: self, options: nil)?[0] as! VBHeader 36 | let layer = expandTableview.viewHeader.layer 37 | layer.shadowColor = UIColor.black.cgColor 38 | layer.shadowOffset = CGSize(width: 0, height: 2) 39 | layer.shadowOpacity = 0.4 40 | layer.shadowRadius = 2 41 | layer.cornerRadius = 10.0 42 | expandTableview.lblDate.text = Date().toString(format:"EEEE, MMM d, yyyy") 43 | expandTableview.btnExpand.tag = section 44 | expandTableview.btnExpand.addTarget(self, action: #selector(VBExpandVC.headerCellButtonTapped(_sender:)), for: UIControlEvents.touchUpInside) 45 | 46 | let str:String = arrStatus[section] as! String 47 | if str == "0" 48 | { 49 | UIView.animate(withDuration: 2) { () -> Void in 50 | self.expandTableview.imgArrow.image = UIImage(named :"ExpandDownArrow") 51 | let angle = CGFloat(M_PI * 2) 52 | let tr = CGAffineTransform.identity.rotated(by: angle) 53 | self.expandTableview.imgArrow.transform = tr 54 | } 55 | } 56 | else 57 | { 58 | UIView.animate(withDuration: 2) { () -> Void in 59 | self.expandTableview.imgArrow.image = UIImage(named :"ExpandUpArrow") 60 | let angle = CGFloat(M_PI * 2) 61 | let tr = CGAffineTransform.identity.rotated(by: angle) 62 | self.expandTableview.imgArrow.transform = tr 63 | } 64 | } 65 | 66 | return expandTableview 67 | } 68 | func headerCellButtonTapped(_sender: UIButton) 69 | { 70 | let str:String = arrStatus[_sender.tag] as! String 71 | if str == "0" 72 | { 73 | arrStatus[_sender.tag] = "1" 74 | 75 | } 76 | else 77 | { 78 | arrStatus[_sender.tag] = "0" 79 | } 80 | myTableView.reloadData() 81 | } 82 | 83 | func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat 84 | { 85 | //Return header height as per your header hieght of xib 86 | return 40 87 | } 88 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ 89 | 90 | let str:String = arrStatus[section] as! String 91 | 92 | if str == "0" 93 | { 94 | return 0 95 | } 96 | return 1 97 | } 98 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{ 99 | 100 | cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! VCExpandCell 101 | 102 | return cell; 103 | } 104 | func numberOfSections(in tableView: UITableView) -> Int 105 | { 106 | return 10 107 | } 108 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat 109 | { 110 | //Return row height as per your cell in tableview 111 | return 111 112 | } 113 | 114 | /* 115 | // MARK: - Navigation 116 | 117 | // In a storyboard-based application, you will often want to do a little preparation before navigation 118 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 119 | // Get the new view controller using segue.destinationViewController. 120 | // Pass the selected object to the new view controller. 121 | } 122 | */ 123 | 124 | 125 | } 126 | extension Date { 127 | func toString(format: String) -> String { 128 | let dateFormatter = DateFormatter() 129 | dateFormatter.dateFormat = format 130 | return dateFormatter.string(from: self) 131 | } 132 | } 133 | 134 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/VBHeader.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VBHeader.swift 3 | // VBExpand_Tableview 4 | // 5 | // Created by Vimal on 8/16/17. 6 | // Copyright © 2017 Crypton. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class VBHeader: UIView { 12 | 13 | @IBOutlet var viewHeader: UIView! 14 | @IBOutlet var lblDate: UILabel! 15 | @IBOutlet var btnExpand: UIButton! 16 | @IBOutlet var imgArrow: UIImageView! 17 | 18 | } 19 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/VBHeader.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 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 | -------------------------------------------------------------------------------- /VBExpand_Tableview/VBExpand_Tableview/VCExpandCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VCExpandCell.swift 3 | // VBExpand_Tableview 4 | // 5 | // Created by Vimal on 8/16/17. 6 | // Copyright © 2017 Crypton. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class VCExpandCell: UITableViewCell { 12 | 13 | override func awakeFromNib() { 14 | super.awakeFromNib() 15 | // Initialization code 16 | } 17 | 18 | override func setSelected(_ selected: Bool, animated: Bool) { 19 | super.setSelected(selected, animated: animated) 20 | 21 | // Configure the view for the selected state 22 | } 23 | 24 | } 25 | --------------------------------------------------------------------------------