├── screenshot
└── preview.gif
├── SwipeableCellView
├── Images.xcassets
│ ├── copy.imageset
│ │ ├── copy.png
│ │ └── Contents.json
│ ├── qrcode.imageset
│ │ ├── qrcode.png
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── ViewController.h
├── AppDelegate.h
├── main.m
├── Info.plist
├── lib
│ ├── SwipeableCell.h
│ └── SwipeableCell.m
├── Base.lproj
│ ├── Main.storyboard
│ └── LaunchScreen.xib
├── AppDelegate.m
└── ViewController.m
├── SwipeableCellView.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── project.pbxproj
├── .gitignore
├── SwipeableCellViewTests
├── Info.plist
└── SwipeableCellViewTests.m
├── LICENSE
└── README.md
/screenshot/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-bootstrap/SwipeableCellView/HEAD/screenshot/preview.gif
--------------------------------------------------------------------------------
/SwipeableCellView/Images.xcassets/copy.imageset/copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-bootstrap/SwipeableCellView/HEAD/SwipeableCellView/Images.xcassets/copy.imageset/copy.png
--------------------------------------------------------------------------------
/SwipeableCellView/Images.xcassets/qrcode.imageset/qrcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-bootstrap/SwipeableCellView/HEAD/SwipeableCellView/Images.xcassets/qrcode.imageset/qrcode.png
--------------------------------------------------------------------------------
/SwipeableCellView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwipeableCellView/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // SwipeableCellView
4 | //
5 | // Created by xdf on 4/20/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UITableViewController
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/SwipeableCellView/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // SwipeableCellView
4 | //
5 | // Created by xdf on 4/20/15.
6 | // Copyright (c) 2015 xdf. 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 |
--------------------------------------------------------------------------------
/SwipeableCellView/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // SwipeableCellView
4 | //
5 | // Created by xdf on 4/20/15.
6 | // Copyright (c) 2015 xdf. 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 |
--------------------------------------------------------------------------------
/SwipeableCellView/Images.xcassets/copy.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x",
10 | "filename" : "copy.png"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/SwipeableCellView/Images.xcassets/qrcode.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x",
10 | "filename" : "qrcode.png"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/.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 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | Pods/
27 |
28 | #temp
29 | .DS_Store
30 | Thumbs.db
31 | *.sw*
32 | *.un~
33 |
--------------------------------------------------------------------------------
/SwipeableCellView/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 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/SwipeableCellViewTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | xudafeng.com.$(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 |
--------------------------------------------------------------------------------
/SwipeableCellViewTests/SwipeableCellViewTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // SwipeableCellViewTests.m
3 | // SwipeableCellViewTests
4 | //
5 | // Created by xdf on 4/20/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface SwipeableCellViewTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation SwipeableCellViewTests
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 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 xdf
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | 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, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/SwipeableCellView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | xudafeng.com.$(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 |
40 |
41 |
--------------------------------------------------------------------------------
/SwipeableCellView/lib/SwipeableCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // SwipeableCell.h
3 | // SwipeableCellView
4 | //
5 | // Created by xdf on 1/10/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class SwipeableCell;
12 |
13 | @protocol SwipeableCellDataSource
14 |
15 | @required
16 | - (NSInteger)numberOfButtonsInSwipeableCell:(SwipeableCell *)cell;
17 | @optional
18 | - (UIButton *)swipeableCell:(SwipeableCell *)cell buttonForIndex:(NSInteger)index;
19 | - (NSString *)swipeableCell:(SwipeableCell *)cell titleForButtonAtIndex:(NSInteger)index;
20 | - (UIColor *)swipeableCell:(SwipeableCell *)cell backgroundColorForButtonAtIndex:(NSInteger)index;
21 | - (UIColor *)swipeableCell:(SwipeableCell *)cell tintColorForButtonAtIndex:(NSInteger)index;
22 | - (UIImage *)swipeableCell:(SwipeableCell *)cell imageForButtonAtIndex:(NSInteger)index;
23 | - (UIFont *)swipeableCell:(SwipeableCell *)cell fontForButtonAtIndex:(NSInteger)index;
24 | @end
25 |
26 | @protocol SwipeableCellDelegate
27 | - (void)swipeableCell:(SwipeableCell *)cell didSelectButtonAtIndex:(NSInteger)index;
28 | - (void)swipeableCellDidOpen:(SwipeableCell *)cell;
29 | - (void)swipeableCellDidClose:(SwipeableCell *)cell;
30 | @end
31 |
32 | @interface SwipeableCell : UITableViewCell
33 | @property (nonatomic, strong) UIView *containerView;
34 | @property (nonatomic, weak) id delegate;
35 | @property (nonatomic, weak) id dataSource;
36 | @property (nonatomic, strong) UILabel *customLabel;
37 | - (void)openCell:(BOOL)animated;
38 | - (void)closeCell:(BOOL)animated;
39 | @end
40 |
--------------------------------------------------------------------------------
/SwipeableCellView/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 |
--------------------------------------------------------------------------------
/SwipeableCellView/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // SwipeableCellView
4 | //
5 | // Created by xdf on 4/20/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "ViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
21 | self.window.backgroundColor = [UIColor whiteColor];
22 | UINavigationController *nav = [[UINavigationController alloc]init];
23 | nav.interactivePopGestureRecognizer.enabled = NO;
24 | self.window.rootViewController = nav;
25 | ViewController *controller = [[ViewController alloc] init];
26 | [nav pushViewController:controller animated:NO];
27 | [self.window makeKeyAndVisible];
28 | return YES;
29 | }
30 |
31 | - (void)applicationWillResignActive:(UIApplication *)application {
32 | // 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.
33 | // 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.
34 | }
35 |
36 | - (void)applicationDidEnterBackground:(UIApplication *)application {
37 | // 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.
38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
39 | }
40 |
41 | - (void)applicationWillEnterForeground:(UIApplication *)application {
42 | // 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.
43 | }
44 |
45 | - (void)applicationDidBecomeActive:(UIApplication *)application {
46 | // 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.
47 | }
48 |
49 | - (void)applicationWillTerminate:(UIApplication *)application {
50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
51 | }
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/SwipeableCellView/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 |
--------------------------------------------------------------------------------
/SwipeableCellView/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // SwipeableCellView
4 | //
5 | // Created by xdf on 4/20/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import "SwipeableCell.h"
10 | #import "ViewController.h"
11 |
12 | @interface ViewController ()
13 | @property (nonatomic, strong) NSMutableArray *isEditing;
14 | @property (strong) UIView *maskView;
15 | @end
16 |
17 | static NSString * const cellIdentifier = @"swipetablecell";
18 |
19 | @implementation ViewController
20 |
21 | - (void)viewDidLoad {
22 | [super viewDidLoad];
23 | [self initView];
24 | }
25 |
26 | - (void)initView {
27 | [self.tableView registerClass:[SwipeableCell class] forCellReuseIdentifier:cellIdentifier];
28 | self.isEditing = [NSMutableArray array];
29 | }
30 |
31 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
32 | return YES;
33 | }
34 |
35 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
36 | return 1;
37 | }
38 |
39 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
40 | return 60.0f;
41 | }
42 |
43 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
44 | return 10;
45 | }
46 |
47 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
48 | SwipeableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
49 | cell.customLabel.text = [NSString stringWithFormat:@"This is the %ld row", (long)indexPath.row];
50 | cell.dataSource = self;
51 | cell.delegate = self;
52 | [cell setNeedsUpdateConstraints];
53 | if ([self.isEditing containsObject:indexPath]) {
54 | [cell openCell:NO];
55 | }
56 | return cell;
57 | }
58 |
59 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
60 | return NO;
61 | }
62 |
63 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
64 |
65 | }
66 |
67 | - (NSInteger)numberOfButtonsInSwipeableCell:(SwipeableCell *)cell {
68 | return 3;
69 | }
70 |
71 | - (NSString *)swipeableCell:(SwipeableCell *)cell titleForButtonAtIndex:(NSInteger)index {
72 | NSString *res;
73 | if (index == 0) {
74 | res = @"third";
75 | } else if (index == 1) {
76 | res = @"second";
77 | } else {
78 | res = @"first";
79 | }
80 | return res;
81 | }
82 |
83 | - (UIImage *)swipeableCell:(SwipeableCell *)cell imageForButtonAtIndex:(NSInteger)index {
84 | NSString *res;
85 | if (index == 0) {
86 | res = @"copy";
87 | } else {
88 | res = @"qrcode";
89 | }
90 | return [UIImage imageNamed: res];
91 | }
92 |
93 | - (UIColor *)swipeableCell:(SwipeableCell *)cell backgroundColorForButtonAtIndex:(NSInteger)index {
94 | UIColor *res;
95 | if (index == 0) {
96 | res = [UIColor blackColor];
97 | } else if (index == 1) {
98 | res = [UIColor grayColor];
99 | } else {
100 | res = [UIColor lightGrayColor];
101 | }
102 | return res;
103 | }
104 |
105 | - (UIColor *)swipeableCell:(SwipeableCell *)cell tintColorForButtonAtIndex:(NSInteger)index {
106 | return [UIColor whiteColor];
107 | }
108 |
109 | - (void)swipeableCell:(SwipeableCell *)cell didSelectButtonAtIndex:(NSInteger)index {
110 |
111 | }
112 |
113 | -(void)onTapHandle:(UITapGestureRecognizer *)sender{
114 | self.navigationController.navigationBar.hidden = NO;
115 | [UIView animateWithDuration: .5 animations:^{
116 | self.maskView.alpha = 0;
117 | } completion:^(BOOL finished) {
118 | [self.maskView removeFromSuperview];
119 | }];
120 | }
121 |
122 | - (void)swipeableCellDidOpen:(SwipeableCell *)cell {
123 | NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:cell.center];
124 | [self.isEditing addObject:indexPath];
125 | }
126 |
127 | - (void)swipeableCellDidClose:(SwipeableCell *)cell {
128 | NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:cell.center];
129 | [self.isEditing removeObject:indexPath];
130 | }
131 |
132 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
133 | return @"header";
134 | }
135 |
136 | @end
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SwipeableCell
2 |
3 | ## Preview
4 |
5 | 
6 |
7 | ## Usage
8 |
9 | ### Installation
10 |
11 | copy `SwipeableCell.h`, `SwipeableCell.m` into your project.
12 |
13 |
14 | Add the following import to the top of the file:
15 |
16 | ``` objc
17 | #import "SwipeableCell.h"
18 | ```
19 |
20 | ### Configuration
21 |
22 | ``` objc
23 | #import "SwipeableCell.h"
24 | #import "ViewController.h"
25 |
26 | @interface ViewController ()
27 | @property (nonatomic, strong) NSMutableArray *isEditing;
28 | @property (strong) UIView *maskView;
29 | @end
30 |
31 | static NSString * const cellIdentifier = @"swipetablecell";
32 |
33 | @implementation ViewController
34 |
35 | - (void)viewDidLoad {
36 | [super viewDidLoad];
37 | [self initView];
38 | }
39 |
40 | - (void)initView {
41 | [self.tableView registerClass:[SwipeableCell class] forCellReuseIdentifier:cellIdentifier];
42 | self.isEditing = [NSMutableArray array];
43 | }
44 |
45 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
46 | return YES;
47 | }
48 |
49 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
50 | return 1;
51 | }
52 |
53 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
54 | return 60.0f;
55 | }
56 |
57 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
58 | return 10;
59 | }
60 |
61 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
62 | SwipeableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
63 | cell.customLabel.text = [NSString stringWithFormat:@"This is the %ld row", (long)indexPath.row];
64 | cell.dataSource = self;
65 | cell.delegate = self;
66 | [cell setNeedsUpdateConstraints];
67 | if ([self.isEditing containsObject:indexPath]) {
68 | [cell openCell:NO];
69 | }
70 | return cell;
71 | }
72 |
73 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
74 | return NO;
75 | }
76 |
77 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
78 |
79 | }
80 |
81 | - (NSInteger)numberOfButtonsInSwipeableCell:(SwipeableCell *)cell {
82 | return 3;
83 | }
84 |
85 | - (NSString *)swipeableCell:(SwipeableCell *)cell titleForButtonAtIndex:(NSInteger)index {
86 | NSString *res;
87 | if (index == 0) {
88 | res = @"third";
89 | } else if (index == 1) {
90 | res = @"second";
91 | } else {
92 | res = @"first";
93 | }
94 | return res;
95 | }
96 |
97 | - (UIImage *)swipeableCell:(SwipeableCell *)cell imageForButtonAtIndex:(NSInteger)index {
98 | NSString *res;
99 | if (index == 0) {
100 | res = @"copy";
101 | } else {
102 | res = @"qrcode";
103 | }
104 | return [UIImage imageNamed: res];
105 | }
106 |
107 | - (UIColor *)swipeableCell:(SwipeableCell *)cell backgroundColorForButtonAtIndex:(NSInteger)index {
108 | UIColor *res;
109 | if (index == 0) {
110 | res = [UIColor blackColor];
111 | } else if (index == 1) {
112 | res = [UIColor grayColor];
113 | } else {
114 | res = [UIColor lightGrayColor];
115 | }
116 | return res;
117 | }
118 |
119 | - (UIColor *)swipeableCell:(SwipeableCell *)cell tintColorForButtonAtIndex:(NSInteger)index {
120 | return [UIColor whiteColor];
121 | }
122 |
123 | - (void)swipeableCell:(SwipeableCell *)cell didSelectButtonAtIndex:(NSInteger)index {
124 |
125 | }
126 |
127 | -(void)onTapHandle:(UITapGestureRecognizer *)sender{
128 | self.navigationController.navigationBar.hidden = NO;
129 | [UIView animateWithDuration: .5 animations:^{
130 | self.maskView.alpha = 0;
131 | } completion:^(BOOL finished) {
132 | [self.maskView removeFromSuperview];
133 | }];
134 | }
135 |
136 | - (void)swipeableCellDidOpen:(SwipeableCell *)cell {
137 | NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:cell.center];
138 | [self.isEditing addObject:indexPath];
139 | }
140 |
141 | - (void)swipeableCellDidClose:(SwipeableCell *)cell {
142 | NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:cell.center];
143 | [self.isEditing removeObject:indexPath];
144 | }
145 |
146 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
147 | return @"header";
148 | }
149 |
150 | @end
151 |
152 | ```
153 |
154 | ## License
155 |
156 | The MIT License (MIT)
157 |
158 | Copyright (c) 2015 xdf
159 |
--------------------------------------------------------------------------------
/SwipeableCellView/lib/SwipeableCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // SwipeableCell.m
3 | // SwipeableCellView
4 | //
5 | // Created by xdf on 1/10/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import "SwipeableCell.h"
10 |
11 | @interface SwipeableCell()
12 | @property (nonatomic, strong) NSMutableArray *buttons;
13 | @property (nonatomic, assign) CGPoint panStartPoint;
14 | @property (nonatomic, assign) CGFloat startingRightLayoutConstraintConstant;
15 | @property (nonatomic, strong) NSLayoutConstraint *contentViewRightConstraint;
16 | @property (nonatomic, strong) NSLayoutConstraint *contentViewLeftConstraint;
17 | @end
18 |
19 | @implementation SwipeableCell
20 |
21 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
22 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
23 | self.selectionStyle = UITableViewCellSelectionStyleNone;
24 | self.buttons = [NSMutableArray array];
25 | self.containerView = [[UIView alloc] init];
26 | self.containerView.userInteractionEnabled = YES;
27 | self.containerView.clipsToBounds = YES;
28 | self.containerView.backgroundColor = [UIColor whiteColor];
29 | self.containerView.translatesAutoresizingMaskIntoConstraints = NO;
30 | [self.contentView addSubview:self.containerView];
31 |
32 | UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panThisCell:)];
33 | panRecognizer.delegate = self;
34 | [self.containerView addGestureRecognizer:panRecognizer];
35 | [self layoutIfNeeded];
36 | CGRect rect = [ UIScreen mainScreen ].applicationFrame;
37 | CGFloat offsetLeft = 15;
38 | self.customLabel = [[UILabel alloc] initWithFrame:CGRectMake(offsetLeft, 0, rect.size.width - offsetLeft * 2, 60.0f)];
39 | self.customLabel.numberOfLines = 0;
40 | [self.containerView addSubview: self.customLabel];
41 | }
42 | return self;
43 | }
44 |
45 | - (void)updateConstraints {
46 | [super updateConstraints];
47 | if (!self.contentViewLeftConstraint) {
48 | NSDictionary *views = @{ @"containerView" : self.containerView };
49 | NSArray *verticalConstraints = [NSLayoutConstraint
50 | constraintsWithVisualFormat:@"V:|[containerView]|"
51 | options:0
52 | metrics:nil
53 | views:views];
54 | [self.contentView addConstraints:verticalConstraints];
55 | NSArray *horizontalConstraints = [NSLayoutConstraint
56 | constraintsWithVisualFormat:@"H:|[containerView]|"
57 | options:0
58 | metrics:0
59 | views:views];
60 | self.contentViewLeftConstraint = horizontalConstraints[0];
61 | self.contentViewRightConstraint = horizontalConstraints[1];
62 |
63 | [self.contentView addConstraints:horizontalConstraints];
64 | }
65 | }
66 |
67 | - (void)configureButtons {
68 | CGFloat previousMinX = CGRectGetWidth(self.frame);
69 | NSInteger buttons = [self.dataSource numberOfButtonsInSwipeableCell:self];
70 | for (NSInteger i = 0; i < buttons; i++) {
71 | UIButton *button = [self buttonForIndex:i previousButtonMinX:previousMinX];
72 | [self.buttons addObject:button];
73 | previousMinX -= CGRectGetWidth(button.frame);
74 | [self.contentView addSubview:button];
75 | }
76 |
77 | [self.contentView bringSubviewToFront:self.containerView];
78 | }
79 |
80 | - (void)configureButtonsIfNeeded {
81 | if (self.buttons.count == 0) {
82 | [self configureButtons];
83 | }
84 | }
85 |
86 | - (UIButton *)buttonForIndex:(NSInteger)index previousButtonMinX:(CGFloat)previousMinX {
87 | UIButton *button = nil;
88 | if ([self.dataSource respondsToSelector:@selector(swipeableCell:buttonForIndex:)]) {
89 |
90 | button = [self.dataSource swipeableCell:self buttonForIndex:index];
91 | } else {
92 |
93 | button = [UIButton buttonWithType:UIButtonTypeCustom];
94 |
95 | if ([self.dataSource respondsToSelector:@selector(swipeableCell:titleForButtonAtIndex:)]) {
96 | [button setTitle:[self.dataSource swipeableCell:self titleForButtonAtIndex:index] forState:UIControlStateNormal];
97 | } else {
98 | [button setTitle:@"" forState:UIControlStateNormal];
99 | }
100 |
101 | if ([self.dataSource respondsToSelector:@selector(swipeableCell:imageForButtonAtIndex:)]) {
102 | UIImage *iconImage = [self.dataSource swipeableCell:self imageForButtonAtIndex:index];
103 | if (iconImage) {
104 | [button setImage:[iconImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
105 | }
106 | }
107 |
108 | if ([self.dataSource respondsToSelector:@selector(swipeableCell:tintColorForButtonAtIndex:)]) {
109 | button.tintColor = [self.dataSource swipeableCell:self tintColorForButtonAtIndex:index];
110 | } else {
111 | button.tintColor = [UIColor whiteColor];
112 | }
113 | [button setContentEdgeInsets:UIEdgeInsetsMake(0, 8, 0, 8)];
114 |
115 | if ([self.dataSource respondsToSelector:@selector(swipeableCell:fontForButtonAtIndex:)]) {
116 | button.titleLabel.font = [self.dataSource swipeableCell:self fontForButtonAtIndex:index];
117 | }
118 | [button sizeToFit];
119 |
120 | CGFloat appleRecommendedMinimumTouchPointWidth = 44.0f;
121 | if (button.frame.size.width < appleRecommendedMinimumTouchPointWidth) {
122 | CGRect frame = button.frame;
123 | frame.size.width = appleRecommendedMinimumTouchPointWidth;
124 | button.frame = frame;
125 | }
126 |
127 | if ([self.dataSource respondsToSelector:@selector(swipeableCell:backgroundColorForButtonAtIndex:)]) {
128 | button.backgroundColor = [self.dataSource swipeableCell:self backgroundColorForButtonAtIndex:index];
129 | } else {
130 | if (index == 0) {
131 | button.backgroundColor = [UIColor lightGrayColor];
132 | } else {
133 | button.backgroundColor = [UIColor lightGrayColor];
134 | }
135 | }
136 | }
137 |
138 | CGFloat xOrigin = previousMinX - CGRectGetWidth(button.frame);
139 | button.frame = CGRectMake(xOrigin, 0, CGRectGetWidth(button.frame), CGRectGetHeight(self.frame));
140 | [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
141 | return button;
142 | }
143 |
144 | - (IBAction)buttonClicked:(id)sender {
145 | NSInteger index = [self.buttons indexOfObject:sender];
146 | if (index != NSNotFound) {
147 | [self.delegate swipeableCell:self didSelectButtonAtIndex:index];
148 | }
149 | }
150 |
151 | - (CGFloat)halfOfFirstButtonWidth {
152 | UIButton *firstButton = [self.buttons firstObject];
153 | return (CGRectGetWidth(firstButton.frame) / 2);
154 | }
155 |
156 | - (CGFloat)halfOfLastButtonXPosition {
157 | UIButton *lastButton = [self.buttons lastObject];
158 | CGFloat halfOfLastButton = CGRectGetWidth(lastButton.frame) / 2;
159 | return [self buttonTotalWidth] - halfOfLastButton;
160 | }
161 |
162 | - (CGFloat)buttonTotalWidth {
163 | CGFloat buttonWidth = 0;
164 | for (UIButton *button in self.buttons) {
165 | buttonWidth += CGRectGetWidth(button.frame);
166 | }
167 | return buttonWidth;
168 | }
169 |
170 | - (void)openCell:(BOOL)animated {
171 | [self configureButtonsIfNeeded];
172 | [self setConstraintsToShowAllButtons:animated notifyDelegateDidOpen:NO];
173 | }
174 |
175 | - (void)closeCell:(BOOL)animated {
176 | [self configureButtonsIfNeeded];
177 | [self resetConstraintContstantsToZero:animated notifyDelegateDidClose:NO];
178 | }
179 |
180 | - (void)setConstraintsToShowAllButtons:(BOOL)animated notifyDelegateDidOpen:(BOOL)notifyDelegate {
181 | if (notifyDelegate) {
182 | [self.delegate swipeableCellDidOpen:self];
183 | }
184 |
185 | CGFloat buttonTotalWidth = [self buttonTotalWidth];
186 | if (self.startingRightLayoutConstraintConstant == buttonTotalWidth && self.contentViewRightConstraint.constant == buttonTotalWidth) {
187 | return;
188 | }
189 |
190 | self.contentViewLeftConstraint.constant = -buttonTotalWidth;
191 | self.contentViewRightConstraint.constant = buttonTotalWidth;
192 |
193 | [self updateConstraintsIfNeeded:animated completion:^(BOOL finished) {
194 | self.startingRightLayoutConstraintConstant = self.contentViewRightConstraint.constant;
195 | }];
196 | }
197 |
198 | - (void)resetConstraintContstantsToZero:(BOOL)animated notifyDelegateDidClose:(BOOL)notifyDelegate {
199 | if (notifyDelegate) {
200 | [self.delegate swipeableCellDidClose:self];
201 | }
202 | if (self.startingRightLayoutConstraintConstant == 0 && self.contentViewRightConstraint.constant == 0) {
203 | return;
204 | }
205 |
206 | self.contentViewRightConstraint.constant = 0;
207 | self.contentViewLeftConstraint.constant = 0;
208 | [self updateConstraintsIfNeeded:animated completion:^(BOOL finished) {
209 | self.startingRightLayoutConstraintConstant = self.contentViewRightConstraint.constant;
210 | }];
211 | }
212 |
213 | - (void)updateConstraintsIfNeeded:(BOOL)animated completion:(void (^)(BOOL finished))completion; {
214 | float duration = 0;
215 | if (animated) {
216 | duration = 0.4;
217 | }
218 |
219 | [UIView animateWithDuration:duration
220 | delay:0
221 | usingSpringWithDamping:0.6
222 | initialSpringVelocity:0
223 | options:UIViewAnimationOptionCurveEaseOut
224 | animations:^{
225 | [self layoutIfNeeded];
226 | } completion:completion];
227 | }
228 |
229 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
230 | if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
231 | UIPanGestureRecognizer *panGesture = (UIPanGestureRecognizer*)gestureRecognizer;
232 | CGPoint velocity = [panGesture velocityInView:self.containerView];
233 | if (velocity.x > 0) {
234 | return YES;
235 | } else if (fabs(velocity.x) > fabs(velocity.y)) {
236 | return NO;
237 | }
238 | }
239 |
240 | return YES;
241 | }
242 |
243 | - (void)panThisCell:(UIPanGestureRecognizer *)recognizer {
244 | CGPoint currentPoint = [recognizer translationInView:self.containerView];
245 | BOOL movingHorizontally = fabs(self.panStartPoint.y) < fabs(self.panStartPoint.x);
246 |
247 | switch (recognizer.state) {
248 | case UIGestureRecognizerStateBegan:
249 | [self configureButtonsIfNeeded];
250 | self.panStartPoint = currentPoint;
251 | self.startingRightLayoutConstraintConstant = self.contentViewRightConstraint.constant;
252 | break;
253 | case UIGestureRecognizerStateChanged: {
254 | if(movingHorizontally) {
255 | CGFloat deltaX = currentPoint.x - self.panStartPoint.x;
256 | BOOL panningLeft = NO;
257 | if (currentPoint.x < self.panStartPoint.x) {
258 | panningLeft = YES;
259 | }
260 |
261 | CGFloat adjustment = self.startingRightLayoutConstraintConstant - deltaX;
262 | if (panningLeft) {
263 | CGFloat constant = MIN(adjustment, [self buttonTotalWidth]);
264 | if (constant == [self buttonTotalWidth]) {
265 | [self setConstraintsToShowAllButtons:YES notifyDelegateDidOpen:NO];
266 | } else {
267 | self.contentViewRightConstraint.constant = constant;
268 | }
269 | } else {
270 | CGFloat constant = MAX(adjustment, 0);
271 | if (constant == 0) {
272 | [self resetConstraintContstantsToZero:YES notifyDelegateDidClose:NO];
273 | } else {
274 | self.contentViewRightConstraint.constant = constant;
275 | }
276 | }
277 |
278 | self.contentViewLeftConstraint.constant = -self.contentViewRightConstraint.constant;
279 | }
280 | }
281 | break;
282 | case UIGestureRecognizerStateEnded:
283 | if(movingHorizontally) {
284 | if (self.startingRightLayoutConstraintConstant == 0) {
285 | CGFloat halfWidth = [self halfOfFirstButtonWidth];
286 | if (halfWidth != 0 && self.contentViewRightConstraint.constant >= halfWidth) {
287 | [self setConstraintsToShowAllButtons:YES notifyDelegateDidOpen:YES];
288 | } else {
289 | [self resetConstraintContstantsToZero:YES notifyDelegateDidClose:YES];
290 | }
291 | } else {
292 | if (self.contentViewRightConstraint.constant >= [self halfOfLastButtonXPosition]) {
293 | [self setConstraintsToShowAllButtons:YES notifyDelegateDidOpen:YES];
294 | } else {
295 | [self resetConstraintContstantsToZero:YES notifyDelegateDidClose:YES];
296 | }
297 | }
298 | }
299 | break;
300 | case UIGestureRecognizerStateCancelled:
301 | if(movingHorizontally) {
302 | if (self.startingRightLayoutConstraintConstant == 0) {
303 | [self resetConstraintContstantsToZero:YES notifyDelegateDidClose:YES];
304 | } else {
305 | [self setConstraintsToShowAllButtons:YES notifyDelegateDidOpen:YES];
306 | }
307 | }
308 | break;
309 |
310 | default:
311 | break;
312 | }
313 | }
314 |
315 | @end
316 |
--------------------------------------------------------------------------------
/SwipeableCellView.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 6345F6E81AEB32B00000F4C0 /* SwipeableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6345F6E71AEB32B00000F4C0 /* SwipeableCell.m */; };
11 | 63578ACF1AE4AB72002DF1D9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 63578ACE1AE4AB72002DF1D9 /* main.m */; };
12 | 63578AD21AE4AB72002DF1D9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 63578AD11AE4AB72002DF1D9 /* AppDelegate.m */; };
13 | 63578AD51AE4AB72002DF1D9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 63578AD41AE4AB72002DF1D9 /* ViewController.m */; };
14 | 63578AD81AE4AB72002DF1D9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 63578AD61AE4AB72002DF1D9 /* Main.storyboard */; };
15 | 63578ADA1AE4AB72002DF1D9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 63578AD91AE4AB72002DF1D9 /* Images.xcassets */; };
16 | 63578ADD1AE4AB72002DF1D9 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63578ADB1AE4AB72002DF1D9 /* LaunchScreen.xib */; };
17 | 63578AE91AE4AB72002DF1D9 /* SwipeableCellViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 63578AE81AE4AB72002DF1D9 /* SwipeableCellViewTests.m */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 63578AE31AE4AB72002DF1D9 /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 63578AC11AE4AB72002DF1D9 /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 63578AC81AE4AB72002DF1D9;
26 | remoteInfo = SwipeableCellView;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | 6345F6E61AEB32B00000F4C0 /* SwipeableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwipeableCell.h; path = lib/SwipeableCell.h; sourceTree = ""; };
32 | 6345F6E71AEB32B00000F4C0 /* SwipeableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SwipeableCell.m; path = lib/SwipeableCell.m; sourceTree = ""; };
33 | 63578AC91AE4AB72002DF1D9 /* SwipeableCellView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwipeableCellView.app; sourceTree = BUILT_PRODUCTS_DIR; };
34 | 63578ACD1AE4AB72002DF1D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
35 | 63578ACE1AE4AB72002DF1D9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
36 | 63578AD01AE4AB72002DF1D9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
37 | 63578AD11AE4AB72002DF1D9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
38 | 63578AD31AE4AB72002DF1D9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
39 | 63578AD41AE4AB72002DF1D9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
40 | 63578AD71AE4AB72002DF1D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
41 | 63578AD91AE4AB72002DF1D9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
42 | 63578ADC1AE4AB72002DF1D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
43 | 63578AE21AE4AB72002DF1D9 /* SwipeableCellViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwipeableCellViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 63578AE71AE4AB72002DF1D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | 63578AE81AE4AB72002DF1D9 /* SwipeableCellViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SwipeableCellViewTests.m; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | 63578AC61AE4AB72002DF1D9 /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | 63578ADF1AE4AB72002DF1D9 /* Frameworks */ = {
57 | isa = PBXFrameworksBuildPhase;
58 | buildActionMask = 2147483647;
59 | files = (
60 | );
61 | runOnlyForDeploymentPostprocessing = 0;
62 | };
63 | /* End PBXFrameworksBuildPhase section */
64 |
65 | /* Begin PBXGroup section */
66 | 63578AC01AE4AB72002DF1D9 = {
67 | isa = PBXGroup;
68 | children = (
69 | 63578ACB1AE4AB72002DF1D9 /* SwipeableCellView */,
70 | 63578AE51AE4AB72002DF1D9 /* SwipeableCellViewTests */,
71 | 63578ACA1AE4AB72002DF1D9 /* Products */,
72 | );
73 | sourceTree = "";
74 | };
75 | 63578ACA1AE4AB72002DF1D9 /* Products */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 63578AC91AE4AB72002DF1D9 /* SwipeableCellView.app */,
79 | 63578AE21AE4AB72002DF1D9 /* SwipeableCellViewTests.xctest */,
80 | );
81 | name = Products;
82 | sourceTree = "";
83 | };
84 | 63578ACB1AE4AB72002DF1D9 /* SwipeableCellView */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 6345F6E61AEB32B00000F4C0 /* SwipeableCell.h */,
88 | 6345F6E71AEB32B00000F4C0 /* SwipeableCell.m */,
89 | 63578AD01AE4AB72002DF1D9 /* AppDelegate.h */,
90 | 63578AD11AE4AB72002DF1D9 /* AppDelegate.m */,
91 | 63578AD31AE4AB72002DF1D9 /* ViewController.h */,
92 | 63578AD41AE4AB72002DF1D9 /* ViewController.m */,
93 | 63578AD61AE4AB72002DF1D9 /* Main.storyboard */,
94 | 63578AD91AE4AB72002DF1D9 /* Images.xcassets */,
95 | 63578ADB1AE4AB72002DF1D9 /* LaunchScreen.xib */,
96 | 63578ACC1AE4AB72002DF1D9 /* Supporting Files */,
97 | );
98 | path = SwipeableCellView;
99 | sourceTree = "";
100 | };
101 | 63578ACC1AE4AB72002DF1D9 /* Supporting Files */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 63578ACD1AE4AB72002DF1D9 /* Info.plist */,
105 | 63578ACE1AE4AB72002DF1D9 /* main.m */,
106 | );
107 | name = "Supporting Files";
108 | sourceTree = "";
109 | };
110 | 63578AE51AE4AB72002DF1D9 /* SwipeableCellViewTests */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 63578AE81AE4AB72002DF1D9 /* SwipeableCellViewTests.m */,
114 | 63578AE61AE4AB72002DF1D9 /* Supporting Files */,
115 | );
116 | path = SwipeableCellViewTests;
117 | sourceTree = "";
118 | };
119 | 63578AE61AE4AB72002DF1D9 /* Supporting Files */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 63578AE71AE4AB72002DF1D9 /* Info.plist */,
123 | );
124 | name = "Supporting Files";
125 | sourceTree = "";
126 | };
127 | /* End PBXGroup section */
128 |
129 | /* Begin PBXNativeTarget section */
130 | 63578AC81AE4AB72002DF1D9 /* SwipeableCellView */ = {
131 | isa = PBXNativeTarget;
132 | buildConfigurationList = 63578AEC1AE4AB72002DF1D9 /* Build configuration list for PBXNativeTarget "SwipeableCellView" */;
133 | buildPhases = (
134 | 63578AC51AE4AB72002DF1D9 /* Sources */,
135 | 63578AC61AE4AB72002DF1D9 /* Frameworks */,
136 | 63578AC71AE4AB72002DF1D9 /* Resources */,
137 | );
138 | buildRules = (
139 | );
140 | dependencies = (
141 | );
142 | name = SwipeableCellView;
143 | productName = SwipeableCellView;
144 | productReference = 63578AC91AE4AB72002DF1D9 /* SwipeableCellView.app */;
145 | productType = "com.apple.product-type.application";
146 | };
147 | 63578AE11AE4AB72002DF1D9 /* SwipeableCellViewTests */ = {
148 | isa = PBXNativeTarget;
149 | buildConfigurationList = 63578AEF1AE4AB72002DF1D9 /* Build configuration list for PBXNativeTarget "SwipeableCellViewTests" */;
150 | buildPhases = (
151 | 63578ADE1AE4AB72002DF1D9 /* Sources */,
152 | 63578ADF1AE4AB72002DF1D9 /* Frameworks */,
153 | 63578AE01AE4AB72002DF1D9 /* Resources */,
154 | );
155 | buildRules = (
156 | );
157 | dependencies = (
158 | 63578AE41AE4AB72002DF1D9 /* PBXTargetDependency */,
159 | );
160 | name = SwipeableCellViewTests;
161 | productName = SwipeableCellViewTests;
162 | productReference = 63578AE21AE4AB72002DF1D9 /* SwipeableCellViewTests.xctest */;
163 | productType = "com.apple.product-type.bundle.unit-test";
164 | };
165 | /* End PBXNativeTarget section */
166 |
167 | /* Begin PBXProject section */
168 | 63578AC11AE4AB72002DF1D9 /* Project object */ = {
169 | isa = PBXProject;
170 | attributes = {
171 | LastUpgradeCheck = 0630;
172 | ORGANIZATIONNAME = xdf;
173 | TargetAttributes = {
174 | 63578AC81AE4AB72002DF1D9 = {
175 | CreatedOnToolsVersion = 6.3;
176 | };
177 | 63578AE11AE4AB72002DF1D9 = {
178 | CreatedOnToolsVersion = 6.3;
179 | TestTargetID = 63578AC81AE4AB72002DF1D9;
180 | };
181 | };
182 | };
183 | buildConfigurationList = 63578AC41AE4AB72002DF1D9 /* Build configuration list for PBXProject "SwipeableCellView" */;
184 | compatibilityVersion = "Xcode 3.2";
185 | developmentRegion = English;
186 | hasScannedForEncodings = 0;
187 | knownRegions = (
188 | en,
189 | Base,
190 | );
191 | mainGroup = 63578AC01AE4AB72002DF1D9;
192 | productRefGroup = 63578ACA1AE4AB72002DF1D9 /* Products */;
193 | projectDirPath = "";
194 | projectRoot = "";
195 | targets = (
196 | 63578AC81AE4AB72002DF1D9 /* SwipeableCellView */,
197 | 63578AE11AE4AB72002DF1D9 /* SwipeableCellViewTests */,
198 | );
199 | };
200 | /* End PBXProject section */
201 |
202 | /* Begin PBXResourcesBuildPhase section */
203 | 63578AC71AE4AB72002DF1D9 /* Resources */ = {
204 | isa = PBXResourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 63578AD81AE4AB72002DF1D9 /* Main.storyboard in Resources */,
208 | 63578ADD1AE4AB72002DF1D9 /* LaunchScreen.xib in Resources */,
209 | 63578ADA1AE4AB72002DF1D9 /* Images.xcassets in Resources */,
210 | );
211 | runOnlyForDeploymentPostprocessing = 0;
212 | };
213 | 63578AE01AE4AB72002DF1D9 /* Resources */ = {
214 | isa = PBXResourcesBuildPhase;
215 | buildActionMask = 2147483647;
216 | files = (
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | };
220 | /* End PBXResourcesBuildPhase section */
221 |
222 | /* Begin PBXSourcesBuildPhase section */
223 | 63578AC51AE4AB72002DF1D9 /* Sources */ = {
224 | isa = PBXSourcesBuildPhase;
225 | buildActionMask = 2147483647;
226 | files = (
227 | 63578AD51AE4AB72002DF1D9 /* ViewController.m in Sources */,
228 | 63578AD21AE4AB72002DF1D9 /* AppDelegate.m in Sources */,
229 | 6345F6E81AEB32B00000F4C0 /* SwipeableCell.m in Sources */,
230 | 63578ACF1AE4AB72002DF1D9 /* main.m in Sources */,
231 | );
232 | runOnlyForDeploymentPostprocessing = 0;
233 | };
234 | 63578ADE1AE4AB72002DF1D9 /* Sources */ = {
235 | isa = PBXSourcesBuildPhase;
236 | buildActionMask = 2147483647;
237 | files = (
238 | 63578AE91AE4AB72002DF1D9 /* SwipeableCellViewTests.m in Sources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | /* End PBXSourcesBuildPhase section */
243 |
244 | /* Begin PBXTargetDependency section */
245 | 63578AE41AE4AB72002DF1D9 /* PBXTargetDependency */ = {
246 | isa = PBXTargetDependency;
247 | target = 63578AC81AE4AB72002DF1D9 /* SwipeableCellView */;
248 | targetProxy = 63578AE31AE4AB72002DF1D9 /* PBXContainerItemProxy */;
249 | };
250 | /* End PBXTargetDependency section */
251 |
252 | /* Begin PBXVariantGroup section */
253 | 63578AD61AE4AB72002DF1D9 /* Main.storyboard */ = {
254 | isa = PBXVariantGroup;
255 | children = (
256 | 63578AD71AE4AB72002DF1D9 /* Base */,
257 | );
258 | name = Main.storyboard;
259 | sourceTree = "";
260 | };
261 | 63578ADB1AE4AB72002DF1D9 /* LaunchScreen.xib */ = {
262 | isa = PBXVariantGroup;
263 | children = (
264 | 63578ADC1AE4AB72002DF1D9 /* Base */,
265 | );
266 | name = LaunchScreen.xib;
267 | sourceTree = "";
268 | };
269 | /* End PBXVariantGroup section */
270 |
271 | /* Begin XCBuildConfiguration section */
272 | 63578AEA1AE4AB72002DF1D9 /* Debug */ = {
273 | isa = XCBuildConfiguration;
274 | buildSettings = {
275 | ALWAYS_SEARCH_USER_PATHS = NO;
276 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
277 | CLANG_CXX_LIBRARY = "libc++";
278 | CLANG_ENABLE_MODULES = YES;
279 | CLANG_ENABLE_OBJC_ARC = YES;
280 | CLANG_WARN_BOOL_CONVERSION = YES;
281 | CLANG_WARN_CONSTANT_CONVERSION = YES;
282 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
283 | CLANG_WARN_EMPTY_BODY = YES;
284 | CLANG_WARN_ENUM_CONVERSION = YES;
285 | CLANG_WARN_INT_CONVERSION = YES;
286 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
287 | CLANG_WARN_UNREACHABLE_CODE = YES;
288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
289 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
290 | COPY_PHASE_STRIP = NO;
291 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
292 | ENABLE_STRICT_OBJC_MSGSEND = YES;
293 | GCC_C_LANGUAGE_STANDARD = gnu99;
294 | GCC_DYNAMIC_NO_PIC = NO;
295 | GCC_NO_COMMON_BLOCKS = YES;
296 | GCC_OPTIMIZATION_LEVEL = 0;
297 | GCC_PREPROCESSOR_DEFINITIONS = (
298 | "DEBUG=1",
299 | "$(inherited)",
300 | );
301 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
302 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
303 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
304 | GCC_WARN_UNDECLARED_SELECTOR = YES;
305 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
306 | GCC_WARN_UNUSED_FUNCTION = YES;
307 | GCC_WARN_UNUSED_VARIABLE = YES;
308 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
309 | MTL_ENABLE_DEBUG_INFO = YES;
310 | ONLY_ACTIVE_ARCH = YES;
311 | SDKROOT = iphoneos;
312 | };
313 | name = Debug;
314 | };
315 | 63578AEB1AE4AB72002DF1D9 /* Release */ = {
316 | isa = XCBuildConfiguration;
317 | buildSettings = {
318 | ALWAYS_SEARCH_USER_PATHS = NO;
319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
320 | CLANG_CXX_LIBRARY = "libc++";
321 | CLANG_ENABLE_MODULES = YES;
322 | CLANG_ENABLE_OBJC_ARC = YES;
323 | CLANG_WARN_BOOL_CONVERSION = YES;
324 | CLANG_WARN_CONSTANT_CONVERSION = YES;
325 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
326 | CLANG_WARN_EMPTY_BODY = YES;
327 | CLANG_WARN_ENUM_CONVERSION = YES;
328 | CLANG_WARN_INT_CONVERSION = YES;
329 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
330 | CLANG_WARN_UNREACHABLE_CODE = YES;
331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
332 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
333 | COPY_PHASE_STRIP = NO;
334 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
335 | ENABLE_NS_ASSERTIONS = NO;
336 | ENABLE_STRICT_OBJC_MSGSEND = YES;
337 | GCC_C_LANGUAGE_STANDARD = gnu99;
338 | GCC_NO_COMMON_BLOCKS = YES;
339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
341 | GCC_WARN_UNDECLARED_SELECTOR = YES;
342 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343 | GCC_WARN_UNUSED_FUNCTION = YES;
344 | GCC_WARN_UNUSED_VARIABLE = YES;
345 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
346 | MTL_ENABLE_DEBUG_INFO = NO;
347 | SDKROOT = iphoneos;
348 | VALIDATE_PRODUCT = YES;
349 | };
350 | name = Release;
351 | };
352 | 63578AED1AE4AB72002DF1D9 /* Debug */ = {
353 | isa = XCBuildConfiguration;
354 | buildSettings = {
355 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356 | INFOPLIST_FILE = SwipeableCellView/Info.plist;
357 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
358 | PRODUCT_NAME = "$(TARGET_NAME)";
359 | };
360 | name = Debug;
361 | };
362 | 63578AEE1AE4AB72002DF1D9 /* Release */ = {
363 | isa = XCBuildConfiguration;
364 | buildSettings = {
365 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
366 | INFOPLIST_FILE = SwipeableCellView/Info.plist;
367 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
368 | PRODUCT_NAME = "$(TARGET_NAME)";
369 | };
370 | name = Release;
371 | };
372 | 63578AF01AE4AB72002DF1D9 /* Debug */ = {
373 | isa = XCBuildConfiguration;
374 | buildSettings = {
375 | BUNDLE_LOADER = "$(TEST_HOST)";
376 | FRAMEWORK_SEARCH_PATHS = (
377 | "$(SDKROOT)/Developer/Library/Frameworks",
378 | "$(inherited)",
379 | );
380 | GCC_PREPROCESSOR_DEFINITIONS = (
381 | "DEBUG=1",
382 | "$(inherited)",
383 | );
384 | INFOPLIST_FILE = SwipeableCellViewTests/Info.plist;
385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
386 | PRODUCT_NAME = "$(TARGET_NAME)";
387 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwipeableCellView.app/SwipeableCellView";
388 | };
389 | name = Debug;
390 | };
391 | 63578AF11AE4AB72002DF1D9 /* Release */ = {
392 | isa = XCBuildConfiguration;
393 | buildSettings = {
394 | BUNDLE_LOADER = "$(TEST_HOST)";
395 | FRAMEWORK_SEARCH_PATHS = (
396 | "$(SDKROOT)/Developer/Library/Frameworks",
397 | "$(inherited)",
398 | );
399 | INFOPLIST_FILE = SwipeableCellViewTests/Info.plist;
400 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
401 | PRODUCT_NAME = "$(TARGET_NAME)";
402 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwipeableCellView.app/SwipeableCellView";
403 | };
404 | name = Release;
405 | };
406 | /* End XCBuildConfiguration section */
407 |
408 | /* Begin XCConfigurationList section */
409 | 63578AC41AE4AB72002DF1D9 /* Build configuration list for PBXProject "SwipeableCellView" */ = {
410 | isa = XCConfigurationList;
411 | buildConfigurations = (
412 | 63578AEA1AE4AB72002DF1D9 /* Debug */,
413 | 63578AEB1AE4AB72002DF1D9 /* Release */,
414 | );
415 | defaultConfigurationIsVisible = 0;
416 | defaultConfigurationName = Release;
417 | };
418 | 63578AEC1AE4AB72002DF1D9 /* Build configuration list for PBXNativeTarget "SwipeableCellView" */ = {
419 | isa = XCConfigurationList;
420 | buildConfigurations = (
421 | 63578AED1AE4AB72002DF1D9 /* Debug */,
422 | 63578AEE1AE4AB72002DF1D9 /* Release */,
423 | );
424 | defaultConfigurationIsVisible = 0;
425 | defaultConfigurationName = Release;
426 | };
427 | 63578AEF1AE4AB72002DF1D9 /* Build configuration list for PBXNativeTarget "SwipeableCellViewTests" */ = {
428 | isa = XCConfigurationList;
429 | buildConfigurations = (
430 | 63578AF01AE4AB72002DF1D9 /* Debug */,
431 | 63578AF11AE4AB72002DF1D9 /* Release */,
432 | );
433 | defaultConfigurationIsVisible = 0;
434 | defaultConfigurationName = Release;
435 | };
436 | /* End XCConfigurationList section */
437 | };
438 | rootObject = 63578AC11AE4AB72002DF1D9 /* Project object */;
439 | }
440 |
--------------------------------------------------------------------------------