├── preview.gif
├── FDExpansionTableViewDemo
├── FDExpansionTableViewDemo
│ ├── cute_boy.png
│ ├── ViewController.h
│ ├── TableViewController1.h
│ ├── TableViewController2.h
│ ├── TableViewController3.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── ViewController.m
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── AppDelegate.m
│ ├── TableViewController3.m
│ ├── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
│ ├── TableViewController1.m
│ └── TableViewController2.m
├── FDExpansionTableViewDemo.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
└── FDExpansionTableViewDemoTests
│ ├── Info.plist
│ └── FDExpansionTableViewDemoTests.m
├── README.md
├── .gitignore
└── LICENSE
/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fergusding/FDExpansionTableView/HEAD/preview.gif
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/cute_boy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fergusding/FDExpansionTableView/HEAD/FDExpansionTableViewDemo/FDExpansionTableViewDemo/cute_boy.png
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/TableViewController1.h:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController1.h
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface TableViewController1 : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/TableViewController2.h:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController2.h
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface TableViewController2 : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/TableViewController3.h:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController3.h
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface TableViewController3 : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FDExpansionTableView
2 |
3 | A implementation of tableview which can expand by the cell.
4 |
5 | # Introduction
6 |
7 | FDExpansionTableView is a demo which indicates the three way to expand table view cell.
8 |
9 | ## Preview
10 |
11 | 
12 |
13 | #License
14 | MIT
15 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. 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 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. 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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 | *.DS_Store
20 |
21 | # CocoaPods
22 | #
23 | # We recommend against adding the Pods directory to your .gitignore. However
24 | # you should judge for yourself, the pros and cons are mentioned at:
25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
26 | #
27 | #Pods/
28 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 | }
21 |
22 | - (void)didReceiveMemoryWarning {
23 | [super didReceiveMemoryWarning];
24 | // Dispose of any resources that can be recreated.
25 | }
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.fergus.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015
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 |
23 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemoTests/FDExpansionTableViewDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // FDExpansionTableViewDemoTests.m
3 | // FDExpansionTableViewDemoTests
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface FDExpansionTableViewDemoTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation FDExpansionTableViewDemoTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/Images.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 | }
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.fergus.$(PRODUCT_NAME:rfc1034identifier)
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 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. 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 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/TableViewController3.m:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController3.m
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #define CellCount 5
10 | #define ExpandCount 3
11 |
12 | #import "TableViewController3.h"
13 |
14 | @interface TableViewController3 ()
15 |
16 | @property (assign, nonatomic) BOOL isExpand;
17 | @property (strong, nonatomic) NSIndexPath *selectedIndexPath;
18 |
19 | @end
20 |
21 | @implementation TableViewController3
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 |
26 | self.isExpand = NO;
27 | self.tableView.tableFooterView = [UIView new];
28 | }
29 |
30 | - (void)didReceiveMemoryWarning {
31 | [super didReceiveMemoryWarning];
32 | }
33 |
34 | #pragma mark - Table view data source
35 |
36 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
37 | return 1;
38 | }
39 |
40 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
41 | return CellCount;
42 | }
43 |
44 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
45 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FriendCell" forIndexPath:indexPath];
46 |
47 | return cell;
48 | }
49 |
50 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
51 | if (self.isExpand && self.selectedIndexPath == indexPath) {
52 | return 121;
53 | } else {
54 | return 44;
55 | }
56 | }
57 |
58 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
59 | if (!self.selectedIndexPath) {
60 | self.isExpand = YES;
61 | self.selectedIndexPath = indexPath;
62 | [self.tableView beginUpdates];
63 | [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
64 | [self.tableView endUpdates];
65 | } else {
66 | if (self.isExpand) {
67 | if (self.selectedIndexPath == indexPath) {
68 | self.isExpand = NO;
69 | [self.tableView beginUpdates];
70 | [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
71 | [self.tableView endUpdates];
72 | self.selectedIndexPath = nil;
73 | } else {
74 | self.isExpand = NO;
75 | [self.tableView beginUpdates];
76 | [self.tableView reloadRowsAtIndexPaths:@[self.selectedIndexPath] withRowAnimation:UITableViewRowAnimationFade];
77 | [self.tableView endUpdates];
78 | self.selectedIndexPath = nil;
79 | }
80 | }
81 | }
82 | }
83 |
84 | @end
85 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/TableViewController1.m:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController1.m
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #define CellCount 5
10 | #define ExpandCount 3
11 |
12 | #import "TableViewController1.h"
13 |
14 | @interface TableViewController1 ()
15 |
16 | @property (assign, nonatomic) BOOL isExpand;
17 | @property (strong, nonatomic) NSIndexPath *selectedIndexPath;
18 |
19 | @end
20 |
21 | @implementation TableViewController1
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | self.isExpand = NO;
26 | self.tableView.tableFooterView = [UIView new];
27 | }
28 |
29 | - (void)didReceiveMemoryWarning {
30 | [super didReceiveMemoryWarning];
31 | }
32 |
33 | #pragma mark - Private
34 |
35 | - (NSArray *)indexPathsForExpandRow:(NSInteger)row {
36 | NSMutableArray *indexPaths = [NSMutableArray array];
37 | for (int i = 1; i <= ExpandCount; i++) {
38 | NSIndexPath *idxPth = [NSIndexPath indexPathForRow:row + i inSection:0];
39 | [indexPaths addObject:idxPth];
40 | }
41 | return [indexPaths copy];
42 | }
43 |
44 | #pragma mark - Table view data source
45 |
46 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
47 | return 1;
48 | }
49 |
50 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
51 | if (self.isExpand) {
52 | return CellCount + ExpandCount;
53 | }
54 | return CellCount;
55 | }
56 |
57 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
58 | UITableViewCell *cell;
59 | if (self.isExpand && self.selectedIndexPath.row < indexPath.row && indexPath.row <= self.selectedIndexPath.row + ExpandCount) { // Expand cell
60 | cell = [tableView dequeueReusableCellWithIdentifier:@"FriendCell" forIndexPath:indexPath];
61 | } else { // Normal cell
62 | cell = [tableView dequeueReusableCellWithIdentifier:@"GroupCell" forIndexPath:indexPath];
63 | }
64 |
65 | return cell;
66 | }
67 |
68 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
69 | if (self.isExpand && self.selectedIndexPath.row < indexPath.row && indexPath.row <= self.selectedIndexPath.row + ExpandCount) {
70 | return 77;
71 | } else {
72 | return 44;
73 | }
74 | }
75 |
76 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
77 | if (!self.selectedIndexPath) {
78 | self.isExpand = YES;
79 | self.selectedIndexPath = indexPath;
80 | [self.tableView beginUpdates];
81 | [self.tableView insertRowsAtIndexPaths:[self indexPathsForExpandRow:indexPath.row] withRowAnimation:UITableViewRowAnimationTop];
82 | [self.tableView endUpdates];
83 | } else {
84 | if (self.isExpand) {
85 | if (self.selectedIndexPath == indexPath) {
86 | self.isExpand = NO;
87 | [self.tableView beginUpdates];
88 | [self.tableView deleteRowsAtIndexPaths:[self indexPathsForExpandRow:indexPath.row] withRowAnimation:UITableViewRowAnimationTop];
89 | [self.tableView endUpdates];
90 | self.selectedIndexPath = nil;
91 | } else if (self.selectedIndexPath.row < indexPath.row && indexPath.row <= self.selectedIndexPath.row + ExpandCount) {
92 | // Select the expand cell, do the relating dealing.
93 | } else {
94 | self.isExpand = NO;
95 | [self.tableView beginUpdates];
96 | [self.tableView deleteRowsAtIndexPaths:[self indexPathsForExpandRow:self.selectedIndexPath.row] withRowAnimation:UITableViewRowAnimationTop];
97 | [self.tableView endUpdates];
98 | self.selectedIndexPath = nil;
99 | }
100 | }
101 | }
102 | }
103 |
104 | @end
105 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/TableViewController2.m:
--------------------------------------------------------------------------------
1 | //
2 | // TableViewController2.m
3 | // FDExpansionTableViewDemo
4 | //
5 | // Created by fergusding on 15/10/9.
6 | // Copyright (c) 2015年 fergusding. All rights reserved.
7 | //
8 |
9 | #define SectionCount 5
10 | #define ExpandCount 3
11 |
12 | #import "TableViewController2.h"
13 |
14 | @interface TableViewController2 ()
15 |
16 | @property (assign, nonatomic) BOOL isExpand;
17 | @property (strong, nonatomic) NSIndexPath *selectedIndexPath;
18 |
19 | @end
20 |
21 | @implementation TableViewController2
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 |
26 | self.isExpand = NO;
27 | self.tableView.tableFooterView = [UIView new];
28 | }
29 |
30 | - (void)didReceiveMemoryWarning {
31 | [super didReceiveMemoryWarning];
32 | // Dispose of any resources that can be recreated.
33 | }
34 |
35 | #pragma mark - Private
36 |
37 | - (NSArray *)indexPathsForExpandSection:(NSInteger)section {
38 | NSMutableArray *indexPaths = [NSMutableArray array];
39 | for (int i = 1; i <= ExpandCount; i++) {
40 | NSIndexPath *idxPth = [NSIndexPath indexPathForRow:i inSection:section];
41 | [indexPaths addObject:idxPth];
42 | }
43 | return [indexPaths copy];
44 | }
45 |
46 | #pragma mark - Table view data source
47 |
48 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
49 | return SectionCount;
50 | }
51 |
52 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
53 | if (self.isExpand && self.selectedIndexPath.section == section) {
54 | return 1 + ExpandCount;
55 | }
56 | return 1;
57 | }
58 |
59 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
60 | UITableViewCell *cell;
61 | if (self.isExpand && self.selectedIndexPath.section == indexPath.section) { // Expand Cell
62 | cell = [tableView dequeueReusableCellWithIdentifier:@"FriendCell" forIndexPath:indexPath];
63 | } else { // Normal Cell
64 | cell = [tableView dequeueReusableCellWithIdentifier:@"GroupCell" forIndexPath:indexPath];
65 | }
66 |
67 | return cell;
68 | }
69 |
70 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
71 | if (self.isExpand && self.selectedIndexPath.section == indexPath.section && indexPath.row != 0) {
72 | return 77;
73 | } else {
74 | return 44;
75 | }
76 | }
77 |
78 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
79 | if (!self.selectedIndexPath) {
80 | self.isExpand = YES;
81 | self.selectedIndexPath = indexPath;
82 | [self.tableView beginUpdates];
83 | [self.tableView insertRowsAtIndexPaths:[self indexPathsForExpandSection:indexPath.section] withRowAnimation:UITableViewRowAnimationTop];
84 | [self.tableView endUpdates];
85 | } else {
86 | if (self.isExpand) {
87 | if (self.selectedIndexPath == indexPath) {
88 | self.isExpand = NO;
89 | [self.tableView beginUpdates];
90 | [self.tableView deleteRowsAtIndexPaths:[self indexPathsForExpandSection:indexPath.section] withRowAnimation:UITableViewRowAnimationTop];
91 | [self.tableView endUpdates];
92 | self.selectedIndexPath = nil;
93 | } else if (self.selectedIndexPath.row != indexPath.row && indexPath.section <= self.selectedIndexPath.section) {
94 | // Select the expand cell, do the relating dealing.
95 | } else {
96 | self.isExpand = NO;
97 | [self.tableView beginUpdates];
98 | [self.tableView deleteRowsAtIndexPaths:[self indexPathsForExpandSection:self.selectedIndexPath.section] withRowAnimation:UITableViewRowAnimationTop];
99 | [self.tableView endUpdates];
100 | self.selectedIndexPath = nil;
101 | }
102 | }
103 | }
104 | }
105 |
106 | @end
107 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | EADA50E61BC7BAF900EA6306 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EADA50E51BC7BAF900EA6306 /* main.m */; };
11 | EADA50E91BC7BAF900EA6306 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EADA50E81BC7BAF900EA6306 /* AppDelegate.m */; };
12 | EADA50EC1BC7BAF900EA6306 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EADA50EB1BC7BAF900EA6306 /* ViewController.m */; };
13 | EADA50EF1BC7BAF900EA6306 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EADA50ED1BC7BAF900EA6306 /* Main.storyboard */; };
14 | EADA50F11BC7BAF900EA6306 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EADA50F01BC7BAF900EA6306 /* Images.xcassets */; };
15 | EADA50F41BC7BAF900EA6306 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = EADA50F21BC7BAF900EA6306 /* LaunchScreen.xib */; };
16 | EADA51001BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EADA50FF1BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.m */; };
17 | EADA510B1BC7BDEC00EA6306 /* TableViewController1.m in Sources */ = {isa = PBXBuildFile; fileRef = EADA510A1BC7BDEC00EA6306 /* TableViewController1.m */; };
18 | EADA510E1BC7BDFA00EA6306 /* TableViewController2.m in Sources */ = {isa = PBXBuildFile; fileRef = EADA510D1BC7BDFA00EA6306 /* TableViewController2.m */; };
19 | EADA51111BC7BE0500EA6306 /* TableViewController3.m in Sources */ = {isa = PBXBuildFile; fileRef = EADA51101BC7BE0500EA6306 /* TableViewController3.m */; };
20 | EADA51141BC8A2D700EA6306 /* cute_boy.png in Resources */ = {isa = PBXBuildFile; fileRef = EADA51131BC8A2D700EA6306 /* cute_boy.png */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXContainerItemProxy section */
24 | EADA50FA1BC7BAF900EA6306 /* PBXContainerItemProxy */ = {
25 | isa = PBXContainerItemProxy;
26 | containerPortal = EADA50D81BC7BAF900EA6306 /* Project object */;
27 | proxyType = 1;
28 | remoteGlobalIDString = EADA50DF1BC7BAF900EA6306;
29 | remoteInfo = FDExpansionTableViewDemo;
30 | };
31 | /* End PBXContainerItemProxy section */
32 |
33 | /* Begin PBXFileReference section */
34 | EADA50E01BC7BAF900EA6306 /* FDExpansionTableViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FDExpansionTableViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
35 | EADA50E41BC7BAF900EA6306 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
36 | EADA50E51BC7BAF900EA6306 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
37 | EADA50E71BC7BAF900EA6306 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
38 | EADA50E81BC7BAF900EA6306 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
39 | EADA50EA1BC7BAF900EA6306 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
40 | EADA50EB1BC7BAF900EA6306 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
41 | EADA50EE1BC7BAF900EA6306 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | EADA50F01BC7BAF900EA6306 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
43 | EADA50F31BC7BAF900EA6306 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
44 | EADA50F91BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FDExpansionTableViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
45 | EADA50FE1BC7BAF900EA6306 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | EADA50FF1BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FDExpansionTableViewDemoTests.m; sourceTree = ""; };
47 | EADA51091BC7BDEC00EA6306 /* TableViewController1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController1.h; sourceTree = ""; };
48 | EADA510A1BC7BDEC00EA6306 /* TableViewController1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController1.m; sourceTree = ""; };
49 | EADA510C1BC7BDFA00EA6306 /* TableViewController2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController2.h; sourceTree = ""; };
50 | EADA510D1BC7BDFA00EA6306 /* TableViewController2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController2.m; sourceTree = ""; };
51 | EADA510F1BC7BE0500EA6306 /* TableViewController3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController3.h; sourceTree = ""; };
52 | EADA51101BC7BE0500EA6306 /* TableViewController3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController3.m; sourceTree = ""; };
53 | EADA51131BC8A2D700EA6306 /* cute_boy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cute_boy.png; sourceTree = ""; };
54 | /* End PBXFileReference section */
55 |
56 | /* Begin PBXFrameworksBuildPhase section */
57 | EADA50DD1BC7BAF900EA6306 /* Frameworks */ = {
58 | isa = PBXFrameworksBuildPhase;
59 | buildActionMask = 2147483647;
60 | files = (
61 | );
62 | runOnlyForDeploymentPostprocessing = 0;
63 | };
64 | EADA50F61BC7BAF900EA6306 /* Frameworks */ = {
65 | isa = PBXFrameworksBuildPhase;
66 | buildActionMask = 2147483647;
67 | files = (
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | EADA50D71BC7BAF900EA6306 = {
75 | isa = PBXGroup;
76 | children = (
77 | EADA50E21BC7BAF900EA6306 /* FDExpansionTableViewDemo */,
78 | EADA50FC1BC7BAF900EA6306 /* FDExpansionTableViewDemoTests */,
79 | EADA50E11BC7BAF900EA6306 /* Products */,
80 | );
81 | sourceTree = "";
82 | };
83 | EADA50E11BC7BAF900EA6306 /* Products */ = {
84 | isa = PBXGroup;
85 | children = (
86 | EADA50E01BC7BAF900EA6306 /* FDExpansionTableViewDemo.app */,
87 | EADA50F91BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.xctest */,
88 | );
89 | name = Products;
90 | sourceTree = "";
91 | };
92 | EADA50E21BC7BAF900EA6306 /* FDExpansionTableViewDemo */ = {
93 | isa = PBXGroup;
94 | children = (
95 | EADA51121BC8A2BF00EA6306 /* Resource */,
96 | EADA50E71BC7BAF900EA6306 /* AppDelegate.h */,
97 | EADA50E81BC7BAF900EA6306 /* AppDelegate.m */,
98 | EADA50EA1BC7BAF900EA6306 /* ViewController.h */,
99 | EADA50EB1BC7BAF900EA6306 /* ViewController.m */,
100 | EADA51091BC7BDEC00EA6306 /* TableViewController1.h */,
101 | EADA510A1BC7BDEC00EA6306 /* TableViewController1.m */,
102 | EADA510C1BC7BDFA00EA6306 /* TableViewController2.h */,
103 | EADA510D1BC7BDFA00EA6306 /* TableViewController2.m */,
104 | EADA510F1BC7BE0500EA6306 /* TableViewController3.h */,
105 | EADA51101BC7BE0500EA6306 /* TableViewController3.m */,
106 | EADA50ED1BC7BAF900EA6306 /* Main.storyboard */,
107 | EADA50F01BC7BAF900EA6306 /* Images.xcassets */,
108 | EADA50F21BC7BAF900EA6306 /* LaunchScreen.xib */,
109 | EADA50E31BC7BAF900EA6306 /* Supporting Files */,
110 | );
111 | path = FDExpansionTableViewDemo;
112 | sourceTree = "";
113 | };
114 | EADA50E31BC7BAF900EA6306 /* Supporting Files */ = {
115 | isa = PBXGroup;
116 | children = (
117 | EADA50E41BC7BAF900EA6306 /* Info.plist */,
118 | EADA50E51BC7BAF900EA6306 /* main.m */,
119 | );
120 | name = "Supporting Files";
121 | sourceTree = "";
122 | };
123 | EADA50FC1BC7BAF900EA6306 /* FDExpansionTableViewDemoTests */ = {
124 | isa = PBXGroup;
125 | children = (
126 | EADA50FF1BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.m */,
127 | EADA50FD1BC7BAF900EA6306 /* Supporting Files */,
128 | );
129 | path = FDExpansionTableViewDemoTests;
130 | sourceTree = "";
131 | };
132 | EADA50FD1BC7BAF900EA6306 /* Supporting Files */ = {
133 | isa = PBXGroup;
134 | children = (
135 | EADA50FE1BC7BAF900EA6306 /* Info.plist */,
136 | );
137 | name = "Supporting Files";
138 | sourceTree = "";
139 | };
140 | EADA51121BC8A2BF00EA6306 /* Resource */ = {
141 | isa = PBXGroup;
142 | children = (
143 | EADA51131BC8A2D700EA6306 /* cute_boy.png */,
144 | );
145 | name = Resource;
146 | sourceTree = "";
147 | };
148 | /* End PBXGroup section */
149 |
150 | /* Begin PBXNativeTarget section */
151 | EADA50DF1BC7BAF900EA6306 /* FDExpansionTableViewDemo */ = {
152 | isa = PBXNativeTarget;
153 | buildConfigurationList = EADA51031BC7BAF900EA6306 /* Build configuration list for PBXNativeTarget "FDExpansionTableViewDemo" */;
154 | buildPhases = (
155 | EADA50DC1BC7BAF900EA6306 /* Sources */,
156 | EADA50DD1BC7BAF900EA6306 /* Frameworks */,
157 | EADA50DE1BC7BAF900EA6306 /* Resources */,
158 | );
159 | buildRules = (
160 | );
161 | dependencies = (
162 | );
163 | name = FDExpansionTableViewDemo;
164 | productName = FDExpansionTableViewDemo;
165 | productReference = EADA50E01BC7BAF900EA6306 /* FDExpansionTableViewDemo.app */;
166 | productType = "com.apple.product-type.application";
167 | };
168 | EADA50F81BC7BAF900EA6306 /* FDExpansionTableViewDemoTests */ = {
169 | isa = PBXNativeTarget;
170 | buildConfigurationList = EADA51061BC7BAF900EA6306 /* Build configuration list for PBXNativeTarget "FDExpansionTableViewDemoTests" */;
171 | buildPhases = (
172 | EADA50F51BC7BAF900EA6306 /* Sources */,
173 | EADA50F61BC7BAF900EA6306 /* Frameworks */,
174 | EADA50F71BC7BAF900EA6306 /* Resources */,
175 | );
176 | buildRules = (
177 | );
178 | dependencies = (
179 | EADA50FB1BC7BAF900EA6306 /* PBXTargetDependency */,
180 | );
181 | name = FDExpansionTableViewDemoTests;
182 | productName = FDExpansionTableViewDemoTests;
183 | productReference = EADA50F91BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.xctest */;
184 | productType = "com.apple.product-type.bundle.unit-test";
185 | };
186 | /* End PBXNativeTarget section */
187 |
188 | /* Begin PBXProject section */
189 | EADA50D81BC7BAF900EA6306 /* Project object */ = {
190 | isa = PBXProject;
191 | attributes = {
192 | LastUpgradeCheck = 0630;
193 | ORGANIZATIONNAME = fergusding;
194 | TargetAttributes = {
195 | EADA50DF1BC7BAF900EA6306 = {
196 | CreatedOnToolsVersion = 6.3.1;
197 | };
198 | EADA50F81BC7BAF900EA6306 = {
199 | CreatedOnToolsVersion = 6.3.1;
200 | TestTargetID = EADA50DF1BC7BAF900EA6306;
201 | };
202 | };
203 | };
204 | buildConfigurationList = EADA50DB1BC7BAF900EA6306 /* Build configuration list for PBXProject "FDExpansionTableViewDemo" */;
205 | compatibilityVersion = "Xcode 3.2";
206 | developmentRegion = English;
207 | hasScannedForEncodings = 0;
208 | knownRegions = (
209 | en,
210 | Base,
211 | );
212 | mainGroup = EADA50D71BC7BAF900EA6306;
213 | productRefGroup = EADA50E11BC7BAF900EA6306 /* Products */;
214 | projectDirPath = "";
215 | projectRoot = "";
216 | targets = (
217 | EADA50DF1BC7BAF900EA6306 /* FDExpansionTableViewDemo */,
218 | EADA50F81BC7BAF900EA6306 /* FDExpansionTableViewDemoTests */,
219 | );
220 | };
221 | /* End PBXProject section */
222 |
223 | /* Begin PBXResourcesBuildPhase section */
224 | EADA50DE1BC7BAF900EA6306 /* Resources */ = {
225 | isa = PBXResourcesBuildPhase;
226 | buildActionMask = 2147483647;
227 | files = (
228 | EADA50EF1BC7BAF900EA6306 /* Main.storyboard in Resources */,
229 | EADA51141BC8A2D700EA6306 /* cute_boy.png in Resources */,
230 | EADA50F41BC7BAF900EA6306 /* LaunchScreen.xib in Resources */,
231 | EADA50F11BC7BAF900EA6306 /* Images.xcassets in Resources */,
232 | );
233 | runOnlyForDeploymentPostprocessing = 0;
234 | };
235 | EADA50F71BC7BAF900EA6306 /* Resources */ = {
236 | isa = PBXResourcesBuildPhase;
237 | buildActionMask = 2147483647;
238 | files = (
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | /* End PBXResourcesBuildPhase section */
243 |
244 | /* Begin PBXSourcesBuildPhase section */
245 | EADA50DC1BC7BAF900EA6306 /* Sources */ = {
246 | isa = PBXSourcesBuildPhase;
247 | buildActionMask = 2147483647;
248 | files = (
249 | EADA50EC1BC7BAF900EA6306 /* ViewController.m in Sources */,
250 | EADA510B1BC7BDEC00EA6306 /* TableViewController1.m in Sources */,
251 | EADA50E91BC7BAF900EA6306 /* AppDelegate.m in Sources */,
252 | EADA51111BC7BE0500EA6306 /* TableViewController3.m in Sources */,
253 | EADA510E1BC7BDFA00EA6306 /* TableViewController2.m in Sources */,
254 | EADA50E61BC7BAF900EA6306 /* main.m in Sources */,
255 | );
256 | runOnlyForDeploymentPostprocessing = 0;
257 | };
258 | EADA50F51BC7BAF900EA6306 /* Sources */ = {
259 | isa = PBXSourcesBuildPhase;
260 | buildActionMask = 2147483647;
261 | files = (
262 | EADA51001BC7BAF900EA6306 /* FDExpansionTableViewDemoTests.m in Sources */,
263 | );
264 | runOnlyForDeploymentPostprocessing = 0;
265 | };
266 | /* End PBXSourcesBuildPhase section */
267 |
268 | /* Begin PBXTargetDependency section */
269 | EADA50FB1BC7BAF900EA6306 /* PBXTargetDependency */ = {
270 | isa = PBXTargetDependency;
271 | target = EADA50DF1BC7BAF900EA6306 /* FDExpansionTableViewDemo */;
272 | targetProxy = EADA50FA1BC7BAF900EA6306 /* PBXContainerItemProxy */;
273 | };
274 | /* End PBXTargetDependency section */
275 |
276 | /* Begin PBXVariantGroup section */
277 | EADA50ED1BC7BAF900EA6306 /* Main.storyboard */ = {
278 | isa = PBXVariantGroup;
279 | children = (
280 | EADA50EE1BC7BAF900EA6306 /* Base */,
281 | );
282 | name = Main.storyboard;
283 | sourceTree = "";
284 | };
285 | EADA50F21BC7BAF900EA6306 /* LaunchScreen.xib */ = {
286 | isa = PBXVariantGroup;
287 | children = (
288 | EADA50F31BC7BAF900EA6306 /* Base */,
289 | );
290 | name = LaunchScreen.xib;
291 | sourceTree = "";
292 | };
293 | /* End PBXVariantGroup section */
294 |
295 | /* Begin XCBuildConfiguration section */
296 | EADA51011BC7BAF900EA6306 /* Debug */ = {
297 | isa = XCBuildConfiguration;
298 | buildSettings = {
299 | ALWAYS_SEARCH_USER_PATHS = NO;
300 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
301 | CLANG_CXX_LIBRARY = "libc++";
302 | CLANG_ENABLE_MODULES = YES;
303 | CLANG_ENABLE_OBJC_ARC = YES;
304 | CLANG_WARN_BOOL_CONVERSION = YES;
305 | CLANG_WARN_CONSTANT_CONVERSION = YES;
306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
307 | CLANG_WARN_EMPTY_BODY = YES;
308 | CLANG_WARN_ENUM_CONVERSION = YES;
309 | CLANG_WARN_INT_CONVERSION = YES;
310 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
311 | CLANG_WARN_UNREACHABLE_CODE = YES;
312 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
313 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
314 | COPY_PHASE_STRIP = NO;
315 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
316 | ENABLE_STRICT_OBJC_MSGSEND = YES;
317 | GCC_C_LANGUAGE_STANDARD = gnu99;
318 | GCC_DYNAMIC_NO_PIC = NO;
319 | GCC_NO_COMMON_BLOCKS = YES;
320 | GCC_OPTIMIZATION_LEVEL = 0;
321 | GCC_PREPROCESSOR_DEFINITIONS = (
322 | "DEBUG=1",
323 | "$(inherited)",
324 | );
325 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
326 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
327 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
328 | GCC_WARN_UNDECLARED_SELECTOR = YES;
329 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
330 | GCC_WARN_UNUSED_FUNCTION = YES;
331 | GCC_WARN_UNUSED_VARIABLE = YES;
332 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
333 | MTL_ENABLE_DEBUG_INFO = YES;
334 | ONLY_ACTIVE_ARCH = YES;
335 | SDKROOT = iphoneos;
336 | TARGETED_DEVICE_FAMILY = "1,2";
337 | };
338 | name = Debug;
339 | };
340 | EADA51021BC7BAF900EA6306 /* Release */ = {
341 | isa = XCBuildConfiguration;
342 | buildSettings = {
343 | ALWAYS_SEARCH_USER_PATHS = NO;
344 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
345 | CLANG_CXX_LIBRARY = "libc++";
346 | CLANG_ENABLE_MODULES = YES;
347 | CLANG_ENABLE_OBJC_ARC = YES;
348 | CLANG_WARN_BOOL_CONVERSION = YES;
349 | CLANG_WARN_CONSTANT_CONVERSION = YES;
350 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
351 | CLANG_WARN_EMPTY_BODY = YES;
352 | CLANG_WARN_ENUM_CONVERSION = YES;
353 | CLANG_WARN_INT_CONVERSION = YES;
354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
355 | CLANG_WARN_UNREACHABLE_CODE = YES;
356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
358 | COPY_PHASE_STRIP = NO;
359 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
360 | ENABLE_NS_ASSERTIONS = NO;
361 | ENABLE_STRICT_OBJC_MSGSEND = YES;
362 | GCC_C_LANGUAGE_STANDARD = gnu99;
363 | GCC_NO_COMMON_BLOCKS = YES;
364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
365 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
366 | GCC_WARN_UNDECLARED_SELECTOR = YES;
367 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
368 | GCC_WARN_UNUSED_FUNCTION = YES;
369 | GCC_WARN_UNUSED_VARIABLE = YES;
370 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
371 | MTL_ENABLE_DEBUG_INFO = NO;
372 | SDKROOT = iphoneos;
373 | TARGETED_DEVICE_FAMILY = "1,2";
374 | VALIDATE_PRODUCT = YES;
375 | };
376 | name = Release;
377 | };
378 | EADA51041BC7BAF900EA6306 /* Debug */ = {
379 | isa = XCBuildConfiguration;
380 | buildSettings = {
381 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
382 | INFOPLIST_FILE = FDExpansionTableViewDemo/Info.plist;
383 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
384 | PRODUCT_NAME = "$(TARGET_NAME)";
385 | };
386 | name = Debug;
387 | };
388 | EADA51051BC7BAF900EA6306 /* Release */ = {
389 | isa = XCBuildConfiguration;
390 | buildSettings = {
391 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
392 | INFOPLIST_FILE = FDExpansionTableViewDemo/Info.plist;
393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
394 | PRODUCT_NAME = "$(TARGET_NAME)";
395 | };
396 | name = Release;
397 | };
398 | EADA51071BC7BAF900EA6306 /* Debug */ = {
399 | isa = XCBuildConfiguration;
400 | buildSettings = {
401 | BUNDLE_LOADER = "$(TEST_HOST)";
402 | FRAMEWORK_SEARCH_PATHS = (
403 | "$(SDKROOT)/Developer/Library/Frameworks",
404 | "$(inherited)",
405 | );
406 | GCC_PREPROCESSOR_DEFINITIONS = (
407 | "DEBUG=1",
408 | "$(inherited)",
409 | );
410 | INFOPLIST_FILE = FDExpansionTableViewDemoTests/Info.plist;
411 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
412 | PRODUCT_NAME = "$(TARGET_NAME)";
413 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FDExpansionTableViewDemo.app/FDExpansionTableViewDemo";
414 | };
415 | name = Debug;
416 | };
417 | EADA51081BC7BAF900EA6306 /* Release */ = {
418 | isa = XCBuildConfiguration;
419 | buildSettings = {
420 | BUNDLE_LOADER = "$(TEST_HOST)";
421 | FRAMEWORK_SEARCH_PATHS = (
422 | "$(SDKROOT)/Developer/Library/Frameworks",
423 | "$(inherited)",
424 | );
425 | INFOPLIST_FILE = FDExpansionTableViewDemoTests/Info.plist;
426 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
427 | PRODUCT_NAME = "$(TARGET_NAME)";
428 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FDExpansionTableViewDemo.app/FDExpansionTableViewDemo";
429 | };
430 | name = Release;
431 | };
432 | /* End XCBuildConfiguration section */
433 |
434 | /* Begin XCConfigurationList section */
435 | EADA50DB1BC7BAF900EA6306 /* Build configuration list for PBXProject "FDExpansionTableViewDemo" */ = {
436 | isa = XCConfigurationList;
437 | buildConfigurations = (
438 | EADA51011BC7BAF900EA6306 /* Debug */,
439 | EADA51021BC7BAF900EA6306 /* Release */,
440 | );
441 | defaultConfigurationIsVisible = 0;
442 | defaultConfigurationName = Release;
443 | };
444 | EADA51031BC7BAF900EA6306 /* Build configuration list for PBXNativeTarget "FDExpansionTableViewDemo" */ = {
445 | isa = XCConfigurationList;
446 | buildConfigurations = (
447 | EADA51041BC7BAF900EA6306 /* Debug */,
448 | EADA51051BC7BAF900EA6306 /* Release */,
449 | );
450 | defaultConfigurationIsVisible = 0;
451 | };
452 | EADA51061BC7BAF900EA6306 /* Build configuration list for PBXNativeTarget "FDExpansionTableViewDemoTests" */ = {
453 | isa = XCConfigurationList;
454 | buildConfigurations = (
455 | EADA51071BC7BAF900EA6306 /* Debug */,
456 | EADA51081BC7BAF900EA6306 /* Release */,
457 | );
458 | defaultConfigurationIsVisible = 0;
459 | };
460 | /* End XCConfigurationList section */
461 | };
462 | rootObject = EADA50D81BC7BAF900EA6306 /* Project object */;
463 | }
464 |
--------------------------------------------------------------------------------
/FDExpansionTableViewDemo/FDExpansionTableViewDemo/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 |
50 |
59 |
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 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
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 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
171 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
230 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
--------------------------------------------------------------------------------