├── .gitignore ├── ExpandableTableView.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── ExpandableTableView ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── ExpandableTableView │ ├── ExpandableTableView.h │ ├── ExpandableTableView.m │ ├── HeaderView.h │ └── HeaderView.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── LICENSE ├── README.md └── _config.yml /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /ExpandableTableView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BC4EA71F1CBD710E00026D99 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4EA71E1CBD710E00026D99 /* main.m */; }; 11 | BC4EA7221CBD710E00026D99 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4EA7211CBD710E00026D99 /* AppDelegate.m */; }; 12 | BC4EA7251CBD710E00026D99 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4EA7241CBD710E00026D99 /* ViewController.m */; }; 13 | BC4EA7281CBD710E00026D99 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BC4EA7261CBD710E00026D99 /* Main.storyboard */; }; 14 | BC4EA72A1CBD710E00026D99 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BC4EA7291CBD710E00026D99 /* Assets.xcassets */; }; 15 | BC4EA72D1CBD710E00026D99 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BC4EA72B1CBD710E00026D99 /* LaunchScreen.storyboard */; }; 16 | BC5C4EDC1CBE4620006E9DBA /* ExpandableTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC5C4ED91CBE4620006E9DBA /* ExpandableTableView.m */; }; 17 | BC5C4EDD1CBE4620006E9DBA /* HeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC5C4EDB1CBE4620006E9DBA /* HeaderView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | BC4EA71A1CBD710E00026D99 /* ExpandableTableView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExpandableTableView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | BC4EA71E1CBD710E00026D99 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | BC4EA7201CBD710E00026D99 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | BC4EA7211CBD710E00026D99 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | BC4EA7231CBD710E00026D99 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | BC4EA7241CBD710E00026D99 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | BC4EA7271CBD710E00026D99 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | BC4EA7291CBD710E00026D99 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | BC4EA72C1CBD710E00026D99 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | BC4EA72E1CBD710E00026D99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | BC5C4ED81CBE4620006E9DBA /* ExpandableTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpandableTableView.h; sourceTree = ""; }; 32 | BC5C4ED91CBE4620006E9DBA /* ExpandableTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExpandableTableView.m; sourceTree = ""; }; 33 | BC5C4EDA1CBE4620006E9DBA /* HeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderView.h; sourceTree = ""; }; 34 | BC5C4EDB1CBE4620006E9DBA /* HeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HeaderView.m; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | BC4EA7171CBD710E00026D99 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | BC4EA7111CBD710E00026D99 = { 49 | isa = PBXGroup; 50 | children = ( 51 | BC4EA71C1CBD710E00026D99 /* ExpandableTableView */, 52 | BC4EA71B1CBD710E00026D99 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | BC4EA71B1CBD710E00026D99 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | BC4EA71A1CBD710E00026D99 /* ExpandableTableView.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | BC4EA71C1CBD710E00026D99 /* ExpandableTableView */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | BC5C4ED71CBE4620006E9DBA /* ExpandableTableView */, 68 | BC4EA7201CBD710E00026D99 /* AppDelegate.h */, 69 | BC4EA7211CBD710E00026D99 /* AppDelegate.m */, 70 | BC4EA7231CBD710E00026D99 /* ViewController.h */, 71 | BC4EA7241CBD710E00026D99 /* ViewController.m */, 72 | BC4EA7261CBD710E00026D99 /* Main.storyboard */, 73 | BC4EA7291CBD710E00026D99 /* Assets.xcassets */, 74 | BC4EA72B1CBD710E00026D99 /* LaunchScreen.storyboard */, 75 | BC4EA72E1CBD710E00026D99 /* Info.plist */, 76 | BC4EA71D1CBD710E00026D99 /* Supporting Files */, 77 | ); 78 | path = ExpandableTableView; 79 | sourceTree = ""; 80 | }; 81 | BC4EA71D1CBD710E00026D99 /* Supporting Files */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | BC4EA71E1CBD710E00026D99 /* main.m */, 85 | ); 86 | name = "Supporting Files"; 87 | sourceTree = ""; 88 | }; 89 | BC5C4ED71CBE4620006E9DBA /* ExpandableTableView */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | BC5C4ED81CBE4620006E9DBA /* ExpandableTableView.h */, 93 | BC5C4ED91CBE4620006E9DBA /* ExpandableTableView.m */, 94 | BC5C4EDA1CBE4620006E9DBA /* HeaderView.h */, 95 | BC5C4EDB1CBE4620006E9DBA /* HeaderView.m */, 96 | ); 97 | path = ExpandableTableView; 98 | sourceTree = ""; 99 | }; 100 | /* End PBXGroup section */ 101 | 102 | /* Begin PBXNativeTarget section */ 103 | BC4EA7191CBD710E00026D99 /* ExpandableTableView */ = { 104 | isa = PBXNativeTarget; 105 | buildConfigurationList = BC4EA7311CBD710E00026D99 /* Build configuration list for PBXNativeTarget "ExpandableTableView" */; 106 | buildPhases = ( 107 | BC4EA7161CBD710E00026D99 /* Sources */, 108 | BC4EA7171CBD710E00026D99 /* Frameworks */, 109 | BC4EA7181CBD710E00026D99 /* Resources */, 110 | ); 111 | buildRules = ( 112 | ); 113 | dependencies = ( 114 | ); 115 | name = ExpandableTableView; 116 | productName = ExpandableTableView; 117 | productReference = BC4EA71A1CBD710E00026D99 /* ExpandableTableView.app */; 118 | productType = "com.apple.product-type.application"; 119 | }; 120 | /* End PBXNativeTarget section */ 121 | 122 | /* Begin PBXProject section */ 123 | BC4EA7121CBD710E00026D99 /* Project object */ = { 124 | isa = PBXProject; 125 | attributes = { 126 | LastUpgradeCheck = 0800; 127 | ORGANIZATIONNAME = "Warif Akhand Rishi"; 128 | TargetAttributes = { 129 | BC4EA7191CBD710E00026D99 = { 130 | CreatedOnToolsVersion = 7.2; 131 | }; 132 | }; 133 | }; 134 | buildConfigurationList = BC4EA7151CBD710E00026D99 /* Build configuration list for PBXProject "ExpandableTableView" */; 135 | compatibilityVersion = "Xcode 3.2"; 136 | developmentRegion = English; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | Base, 141 | ); 142 | mainGroup = BC4EA7111CBD710E00026D99; 143 | productRefGroup = BC4EA71B1CBD710E00026D99 /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | BC4EA7191CBD710E00026D99 /* ExpandableTableView */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | BC4EA7181CBD710E00026D99 /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | BC4EA72D1CBD710E00026D99 /* LaunchScreen.storyboard in Resources */, 158 | BC4EA72A1CBD710E00026D99 /* Assets.xcassets in Resources */, 159 | BC4EA7281CBD710E00026D99 /* Main.storyboard in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXSourcesBuildPhase section */ 166 | BC4EA7161CBD710E00026D99 /* Sources */ = { 167 | isa = PBXSourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | BC4EA7251CBD710E00026D99 /* ViewController.m in Sources */, 171 | BC5C4EDD1CBE4620006E9DBA /* HeaderView.m in Sources */, 172 | BC4EA7221CBD710E00026D99 /* AppDelegate.m in Sources */, 173 | BC4EA71F1CBD710E00026D99 /* main.m in Sources */, 174 | BC5C4EDC1CBE4620006E9DBA /* ExpandableTableView.m in Sources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXSourcesBuildPhase section */ 179 | 180 | /* Begin PBXVariantGroup section */ 181 | BC4EA7261CBD710E00026D99 /* Main.storyboard */ = { 182 | isa = PBXVariantGroup; 183 | children = ( 184 | BC4EA7271CBD710E00026D99 /* Base */, 185 | ); 186 | name = Main.storyboard; 187 | sourceTree = ""; 188 | }; 189 | BC4EA72B1CBD710E00026D99 /* LaunchScreen.storyboard */ = { 190 | isa = PBXVariantGroup; 191 | children = ( 192 | BC4EA72C1CBD710E00026D99 /* Base */, 193 | ); 194 | name = LaunchScreen.storyboard; 195 | sourceTree = ""; 196 | }; 197 | /* End PBXVariantGroup section */ 198 | 199 | /* Begin XCBuildConfiguration section */ 200 | BC4EA72F1CBD710E00026D99 /* Debug */ = { 201 | isa = XCBuildConfiguration; 202 | buildSettings = { 203 | ALWAYS_SEARCH_USER_PATHS = NO; 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_EMPTY_BODY = YES; 212 | CLANG_WARN_ENUM_CONVERSION = YES; 213 | CLANG_WARN_INFINITE_RECURSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 216 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 217 | CLANG_WARN_UNREACHABLE_CODE = YES; 218 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 219 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 220 | COPY_PHASE_STRIP = NO; 221 | DEBUG_INFORMATION_FORMAT = dwarf; 222 | ENABLE_STRICT_OBJC_MSGSEND = YES; 223 | ENABLE_TESTABILITY = YES; 224 | GCC_C_LANGUAGE_STANDARD = gnu99; 225 | GCC_DYNAMIC_NO_PIC = NO; 226 | GCC_NO_COMMON_BLOCKS = YES; 227 | GCC_OPTIMIZATION_LEVEL = 0; 228 | GCC_PREPROCESSOR_DEFINITIONS = ( 229 | "DEBUG=1", 230 | "$(inherited)", 231 | ); 232 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 233 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 234 | GCC_WARN_UNDECLARED_SELECTOR = YES; 235 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 236 | GCC_WARN_UNUSED_FUNCTION = YES; 237 | GCC_WARN_UNUSED_VARIABLE = YES; 238 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 239 | MTL_ENABLE_DEBUG_INFO = YES; 240 | ONLY_ACTIVE_ARCH = YES; 241 | SDKROOT = iphoneos; 242 | TARGETED_DEVICE_FAMILY = "1,2"; 243 | }; 244 | name = Debug; 245 | }; 246 | BC4EA7301CBD710E00026D99 /* Release */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_WARN_BOOL_CONVERSION = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 257 | CLANG_WARN_EMPTY_BODY = YES; 258 | CLANG_WARN_ENUM_CONVERSION = YES; 259 | CLANG_WARN_INFINITE_RECURSION = YES; 260 | CLANG_WARN_INT_CONVERSION = YES; 261 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 262 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 263 | CLANG_WARN_UNREACHABLE_CODE = YES; 264 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 265 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 266 | COPY_PHASE_STRIP = NO; 267 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 268 | ENABLE_NS_ASSERTIONS = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | GCC_C_LANGUAGE_STANDARD = gnu99; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 274 | GCC_WARN_UNDECLARED_SELECTOR = YES; 275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 276 | GCC_WARN_UNUSED_FUNCTION = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 279 | MTL_ENABLE_DEBUG_INFO = NO; 280 | SDKROOT = iphoneos; 281 | TARGETED_DEVICE_FAMILY = "1,2"; 282 | VALIDATE_PRODUCT = YES; 283 | }; 284 | name = Release; 285 | }; 286 | BC4EA7321CBD710E00026D99 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 290 | INFOPLIST_FILE = ExpandableTableView/Info.plist; 291 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 292 | PRODUCT_BUNDLE_IDENTIFIER = com.war.ExpandableTableView; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | }; 295 | name = Debug; 296 | }; 297 | BC4EA7331CBD710E00026D99 /* Release */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | INFOPLIST_FILE = ExpandableTableView/Info.plist; 302 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 303 | PRODUCT_BUNDLE_IDENTIFIER = com.war.ExpandableTableView; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | }; 306 | name = Release; 307 | }; 308 | /* End XCBuildConfiguration section */ 309 | 310 | /* Begin XCConfigurationList section */ 311 | BC4EA7151CBD710E00026D99 /* Build configuration list for PBXProject "ExpandableTableView" */ = { 312 | isa = XCConfigurationList; 313 | buildConfigurations = ( 314 | BC4EA72F1CBD710E00026D99 /* Debug */, 315 | BC4EA7301CBD710E00026D99 /* Release */, 316 | ); 317 | defaultConfigurationIsVisible = 0; 318 | defaultConfigurationName = Release; 319 | }; 320 | BC4EA7311CBD710E00026D99 /* Build configuration list for PBXNativeTarget "ExpandableTableView" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | BC4EA7321CBD710E00026D99 /* Debug */, 324 | BC4EA7331CBD710E00026D99 /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | /* End XCConfigurationList section */ 330 | }; 331 | rootObject = BC4EA7121CBD710E00026D99 /* Project object */; 332 | } 333 | -------------------------------------------------------------------------------- /ExpandableTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ExpandableTableView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ExpandableTableView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /ExpandableTableView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /ExpandableTableView/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 | -------------------------------------------------------------------------------- /ExpandableTableView/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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /ExpandableTableView/ExpandableTableView/ExpandableTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableView.h 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define HEADER_VIEW_HEIGHT 28 12 | 13 | @interface ExpandableTableView : UITableView 14 | 15 | @property (nonatomic, assign) BOOL allHeadersInitiallyCollapsed; 16 | @property (nonatomic, assign) int initiallyExpandedSection; 17 | @property (nonatomic, assign) BOOL singleSelectionEnable; 18 | 19 | - (NSInteger)totalNumberOfRows:(NSInteger)total inSection:(NSInteger)section; 20 | - (UIView *)headerWithTitle:(NSString *)title totalRows:(NSInteger)row inSection:(NSInteger)section; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ExpandableTableView/ExpandableTableView/ExpandableTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExpandableTableView.m 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import "ExpandableTableView.h" 10 | #import "HeaderView.h" 11 | 12 | @interface ExpandableTableView () 13 | 14 | @property (nonatomic, strong) NSMutableDictionary *sectionStatusDic; 15 | @property (nonatomic, strong) HeaderView *prevHeaderView; 16 | 17 | @end 18 | 19 | @implementation ExpandableTableView 20 | 21 | - (instancetype)initWithCoder:(NSCoder *)coder 22 | { 23 | if (self = [super initWithCoder:coder]) { 24 | [self setup]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (instancetype)init 31 | { 32 | if (self = [super init]) { 33 | [self setup]; 34 | } 35 | 36 | return self; 37 | } 38 | 39 | - (instancetype)initWithFrame:(CGRect)frame 40 | { 41 | if (self = [super initWithFrame:frame]) { 42 | [self setup]; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style 49 | { 50 | if (self = [super initWithFrame:frame style:style]) { 51 | [self setup]; 52 | } 53 | 54 | return self; 55 | } 56 | 57 | - (void)setup 58 | { 59 | _sectionStatusDic = [[NSMutableDictionary alloc] init]; 60 | self.initiallyExpandedSection = -1; 61 | } 62 | 63 | - (HeaderView *)headerView { 64 | 65 | HeaderView *headerView = [self dequeueReusableHeaderFooterViewWithIdentifier:@"Header"]; 66 | 67 | if (!headerView) { 68 | CGRect frame = CGRectMake(0, 0, CGRectGetWidth(self.frame), HEADER_VIEW_HEIGHT); 69 | headerView = [[HeaderView alloc] initWithReuseIdentifier:@"Header" andFrame:frame]; 70 | headerView.delegate = self; 71 | } 72 | 73 | return headerView; 74 | } 75 | 76 | - (NSArray *)indexPathsForHeaderView:(HeaderView *)headerView { 77 | 78 | NSMutableArray *indexPaths = [[NSMutableArray alloc] init]; 79 | 80 | for (int i = 0; i < headerView.totalRows; i++) { 81 | [indexPaths addObject:[NSIndexPath indexPathForRow:i inSection:headerView.section]]; 82 | } 83 | 84 | return indexPaths; 85 | } 86 | 87 | - (BOOL)collapsedForSection:(NSInteger)section { 88 | 89 | NSString *key = [NSString stringWithFormat:@"%ld", (long)section]; 90 | 91 | if (self.sectionStatusDic[key]) { 92 | return ((NSNumber *)self.sectionStatusDic[key]).boolValue; 93 | } 94 | 95 | return (self.initiallyExpandedSection == section) ? NO : self.allHeadersInitiallyCollapsed; 96 | } 97 | 98 | - (NSInteger)totalNumberOfRows:(NSInteger)total inSection:(NSInteger)section; { 99 | 100 | return ([self collapsedForSection:section]) ? 0 : total; 101 | } 102 | 103 | - (UIView *)headerWithTitle:(NSString *)title totalRows:(NSInteger)row inSection:(NSInteger)section { 104 | 105 | BOOL isCollapsed = [self collapsedForSection:section]; 106 | 107 | HeaderView *headerView = self.headerView; 108 | [headerView updateWithTitle:title isCollapsed:isCollapsed totalRows:row andSection:section]; 109 | 110 | if (!self.prevHeaderView && self.initiallyExpandedSection == section) { 111 | self.prevHeaderView = headerView; 112 | } 113 | 114 | return headerView; 115 | } 116 | 117 | #pragma mark - HeaderViewDelegate 118 | 119 | - (void)didTapHeader:(HeaderView *)headerView { 120 | 121 | NSString *key = [NSString stringWithFormat:@"%ld", (long)headerView.section]; 122 | BOOL isCollapsed = [self collapsedForSection:headerView.section]; 123 | isCollapsed = !isCollapsed; 124 | 125 | [self.sectionStatusDic setObject:@(isCollapsed) forKey:key]; 126 | 127 | [self beginUpdates]; 128 | 129 | if (self.singleSelectionEnable && self.prevHeaderView != headerView && ![self collapsedForSection:self.prevHeaderView.section]) { 130 | 131 | NSArray *indexPaths = [self indexPathsForHeaderView:self.prevHeaderView]; 132 | [self deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; 133 | 134 | NSString *key = [NSString stringWithFormat:@"%ld", (long)self.prevHeaderView.section]; 135 | [self.sectionStatusDic setObject:@(YES) forKey:key]; 136 | 137 | [self.prevHeaderView updateWithTitle:self.prevHeaderView.title isCollapsed:YES totalRows:self.prevHeaderView.totalRows andSection:self.prevHeaderView.section]; 138 | } 139 | 140 | NSArray *indexPaths = [self indexPathsForHeaderView:headerView]; 141 | 142 | if (isCollapsed) { 143 | [self deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationTop]; 144 | } else { 145 | [self insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationTop]; 146 | } 147 | 148 | [self endUpdates]; 149 | 150 | self.prevHeaderView = headerView; 151 | } 152 | 153 | @end 154 | -------------------------------------------------------------------------------- /ExpandableTableView/ExpandableTableView/HeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderView.h 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class HeaderView; 12 | 13 | @protocol HeaderViewDelegate 14 | 15 | - (void)didTapHeader:(HeaderView *)view; 16 | 17 | @end 18 | 19 | @interface HeaderView : UITableViewHeaderFooterView 20 | 21 | @property (nonatomic, assign) id delegate; 22 | @property (nonatomic, readonly) NSInteger section; 23 | @property (nonatomic, readonly) NSInteger totalRows; 24 | @property (nonatomic, strong, readonly) NSString *title; 25 | 26 | - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier andFrame:(CGRect)frame; 27 | - (void)updateWithTitle:(NSString *)title isCollapsed:(BOOL)isCollapsed totalRows:(NSInteger)row andSection:(NSInteger)section; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ExpandableTableView/ExpandableTableView/HeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderView.m 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import "HeaderView.h" 10 | 11 | @interface HeaderView () 12 | 13 | @property (nonatomic, assign) NSInteger section; 14 | @property (nonatomic, assign) NSInteger totalRows; 15 | @property (nonatomic, strong) UIButton *headerButton; 16 | @property (nonatomic, strong) NSString *title; 17 | @property (nonatomic, assign) BOOL isCollapsed; 18 | 19 | @end 20 | 21 | @implementation HeaderView 22 | 23 | - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier andFrame:(CGRect)frame { 24 | 25 | if (self = [super initWithReuseIdentifier:reuseIdentifier]) { 26 | 27 | self.frame = frame; 28 | 29 | [self addHeaderButton]; 30 | } 31 | 32 | return self; 33 | } 34 | 35 | - (void)addHeaderButton { 36 | 37 | _headerButton = [UIButton buttonWithType:UIButtonTypeCustom]; 38 | self.headerButton.frame = self.bounds; 39 | self.headerButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; 40 | [self.headerButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 41 | [self.headerButton addTarget:self action:@selector(headerButtonAction:) forControlEvents:UIControlEventTouchUpInside]; 42 | 43 | [self.contentView addSubview:self.headerButton]; 44 | } 45 | 46 | - (void)headerButtonAction:(UIButton *)headerButton { 47 | 48 | self.isCollapsed = !self.isCollapsed; 49 | [self setHeaderText]; 50 | 51 | if ([self.delegate respondsToSelector:@selector(didTapHeader:)]) { 52 | [self.delegate didTapHeader:self]; 53 | } 54 | } 55 | 56 | - (void)updateWithTitle:(NSString *)title isCollapsed:(BOOL)isCollapsed totalRows:(NSInteger)row andSection:(NSInteger)section { 57 | 58 | self.title = title; 59 | self.isCollapsed = isCollapsed; 60 | self.section = section; 61 | self.totalRows = row; 62 | 63 | [self setHeaderText]; 64 | } 65 | 66 | - (void)setHeaderText { 67 | 68 | NSString *plusOrMinus = (self.isCollapsed) ? @" +\t" : @" -\t"; 69 | [self.headerButton setTitle:[plusOrMinus stringByAppendingString:self.title] forState:UIControlStateNormal]; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /ExpandableTableView/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ExpandableTableView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ExpandableTableView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ExpandableTableView.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet ExpandableTableView *tableView; 15 | @property (nonatomic, strong) NSArray *headersAndCells; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | self.headersAndCells = @[@{@"Header 1": @[@"Cell 1", @"Cell 2", @"Cell 3"]}, 25 | @{@"Header 2": @[@"Cell 1", @"Cell 2"]}, 26 | @{@"Header 3": @[@"Cell 1", @"Cell 2", @"Cell 3", @"Cell 4", @"Cell 5"]}, 27 | @{@"Header 4": @[]}, 28 | @{@"Header 5": @[@"Cell 1", @"Cell 2", @"Cell 3", @"Cell 4", @"Cell 5", @"Cell 6", @"Cell 7", @"Cell 8"]}, 29 | @{@"Header 6": @[@"Cell 1", @"Cell 2", @"Cell 3", @"Cell 4", @"Cell 5", @"Cell 6", @"Cell 7", @"Cell 8"]}, 30 | @{@"Header 7": @[@"Cell 1", @"Cell 2", @"Cell 3", @"Cell 4", @"Cell 5", @"Cell 6", @"Cell 7", @"Cell 8"]}, 31 | @{@"Header 8": @[@"Cell 1", @"Cell 2", @"Cell 3"]}, 32 | @{@"Header 9": @[@"Cell 1", @"Cell 2", @"Cell 3"]}, 33 | @{@"Header 10": @[@"Cell 1", @"Cell 2", @"Cell 3"]}, 34 | @{@"Header 11": @[@"Cell 1", @"Cell 2", @"Cell 3"]}]; 35 | 36 | self.tableView.allHeadersInitiallyCollapsed = YES; 37 | self.tableView.initiallyExpandedSection = 0; 38 | self.tableView.singleSelectionEnable = YES; 39 | } 40 | 41 | - (void)didReceiveMemoryWarning { 42 | [super didReceiveMemoryWarning]; 43 | } 44 | 45 | - (NSArray *)cellsForSection:(NSInteger)section { 46 | NSDictionary *dic = self.headersAndCells[section]; 47 | return dic.allValues.firstObject; 48 | } 49 | 50 | - (NSString *)sectionTextForSection:(NSInteger)section { 51 | NSDictionary *dic = self.headersAndCells[section]; 52 | return dic.allKeys.firstObject; 53 | } 54 | 55 | #pragma mark - UITableViewDataSource 56 | 57 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 58 | NSArray *cells = [self cellsForSection:section]; 59 | return [self.tableView totalNumberOfRows:cells.count inSection:section]; 60 | } 61 | 62 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 63 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; 64 | cell.textLabel.text = [self cellsForSection:indexPath.section][indexPath.row]; 65 | return cell; 66 | } 67 | 68 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 69 | return self.headersAndCells.count; 70 | } 71 | 72 | #pragma mark - UITableViewDelegate 73 | 74 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 75 | return HEADER_VIEW_HEIGHT; 76 | } 77 | 78 | - (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { 79 | return [self.tableView headerWithTitle:[self sectionTextForSection:section] totalRows:[self cellsForSection:section].count inSection:section]; 80 | } 81 | 82 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 83 | NSLog(@"section-%ld, row-%ld", (long)indexPath.section, (long)indexPath.row); 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /ExpandableTableView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ExpandableTableView 4 | // 5 | // Created by Warif Akhand Rishi on 4/13/16. 6 | // Copyright © 2016 Warif Akhand Rishi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Warif Akhand Rishi 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 | # ExpandableTableView 2 | 3 | [![](http://img.shields.io/badge/iOS-7.0%2B-lightgrey.svg)]() 4 | [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/algolia/UILabel) 5 | 6 | This subclass of UITableView makes the Headers to expand or collapse. 7 | 8 |

9 | 10 | ## Setup 11 | 12 | Latest code uses Xcode 8
13 | For Xcode 7.2 download older release from https://github.com/rishi420/ExpandableTableView/releases 14 | 15 | Simply drag and drop the "ExpandableTableView" directory in your project. This directory has 4 files. 16 | 17 | 1. `ExpandableTableView.h` 18 | 2. `ExpandableTableView.m` 19 | 3. `HeaderView.h` 20 | 4. `HeaderView.m` 21 | 22 | ## How to use 23 | 24 | 1. Change your `UITableView` class to `ExpandableTableView` class in storyboard. 25 | 2. #import "ExpandableTableView.h" 26 | 3. create an `IBOutlet` of ExpandableTableView 27 | 4. In `numberOfRowsInSection` call `totalNumberOfRows:inSection:` 28 | 5. call `headerWithTitle:totalRows:inSection:` in `viewForHeaderInSection` 29 | 30 | ## Features 31 | - To make all Headers start with collapsed state use `allHeadersInitiallyCollapsed` 32 | - To make all Headers start with collapsed state execpt one section use `initiallyExpandedSection` 33 | - To expand only one section at a time use `singleSelectionEnable` 34 | 35 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-merlot --------------------------------------------------------------------------------