Skip to content

Commit 613c34a

Browse files
committed
Add a basic demo project.
1 parent e9533f1 commit 613c34a

File tree

16 files changed

+983
-7
lines changed

16 files changed

+983
-7
lines changed

.gitignore

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# CocoaPods
2-
#
3-
# We recommend against adding the Pods directory to your .gitignore. However
4-
# you should judge for yourself, the pros and cons are mentioned at:
5-
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control?
6-
#
7-
# Pods/
1+
.DS_Store
82

3+
**/xcuserdata
4+
**/xcshareddata
5+
*.pbxuser
6+
*.mode1v3
7+
8+
Podfile.lock
9+
Pods

Demo/SwipeBackDemo.xcodeproj/project.pbxproj

Lines changed: 511 additions & 0 deletions
Large diffs are not rendered by default.

Demo/SwipeBackDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Demo/SwipeBackDemo/AppDelegate.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//
2+
// The MIT License (MIT)
3+
//
4+
// Copyright (c) 2014 Suyeol Jeon
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
//
24+
25+
#import <UIKit/UIKit.h>
26+
27+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
28+
29+
@property (strong, nonatomic) UIWindow *window;
30+
31+
@end

Demo/SwipeBackDemo/AppDelegate.m

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// The MIT License (MIT)
3+
//
4+
// Copyright (c) 2014 Suyeol Jeon
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
//
24+
25+
#import "AppDelegate.h"
26+
#import "DemoViewController.h"
27+
28+
@implementation AppDelegate
29+
30+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
31+
{
32+
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
33+
self.window.backgroundColor = [UIColor whiteColor];
34+
[self.window makeKeyAndVisible];
35+
36+
DemoViewController *rootViewController = [[DemoViewController alloc] init];
37+
rootViewController.navigationItem.title = @"Root View Controller";
38+
39+
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
40+
41+
return YES;
42+
}
43+
44+
@end
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// The MIT License (MIT)
3+
//
4+
// Copyright (c) 2014 Suyeol Jeon
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
//
24+
25+
@interface DemoViewController : UIViewController
26+
@end
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
//
2+
// The MIT License (MIT)
3+
//
4+
// Copyright (c) 2014 Suyeol Jeon
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
//
24+
25+
#import "SwipeBack.h"
26+
#import "DemoViewController.h"
27+
28+
@implementation DemoViewController
29+
30+
- (void)viewDidLoad
31+
{
32+
[super viewDidLoad];
33+
34+
self.view.backgroundColor = [UIColor whiteColor];
35+
36+
UIButton *pushButton = [[UIButton alloc] init];
37+
[pushButton setTitle:@"Push" forState:UIControlStateNormal];
38+
[pushButton setTitleColor:self.view.tintColor forState:UIControlStateNormal];
39+
[pushButton sizeToFit];
40+
pushButton.center = CGPointMake(CGRectGetWidth(self.view.bounds) / 2, CGRectGetHeight(self.view.bounds) / 2);
41+
[pushButton addTarget:self action:@selector(pushViewController) forControlEvents:UIControlEventTouchUpInside];
42+
[self.view addSubview:pushButton];
43+
}
44+
45+
- (void)viewWillAppear:(BOOL)animated
46+
{
47+
[super viewWillAppear:animated];
48+
49+
NSInteger viewControllerCount = self.navigationController.viewControllers.count;
50+
51+
if (!self.navigationItem.title) {
52+
self.navigationItem.title = [NSString stringWithFormat:@"View Controller %ld", viewControllerCount];
53+
}
54+
55+
if (!self.navigationItem.leftBarButtonItem && viewControllerCount > 1) {
56+
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back"
57+
style:UIBarButtonItemStylePlain
58+
target:self
59+
action:@selector(popViewController)];
60+
}
61+
}
62+
63+
- (void)pushViewController
64+
{
65+
DemoViewController *viewController = [[DemoViewController alloc] init];
66+
[self.navigationController pushViewController:viewController animated:YES];
67+
}
68+
69+
- (void)popViewController
70+
{
71+
[self.navigationController popViewControllerAnimated:YES];
72+
}
73+
74+
@end
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "29x29",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "40x40",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "60x60",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "60x60",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "ipad",
25+
"size" : "29x29",
26+
"scale" : "1x"
27+
},
28+
{
29+
"idiom" : "ipad",
30+
"size" : "29x29",
31+
"scale" : "2x"
32+
},
33+
{
34+
"idiom" : "ipad",
35+
"size" : "40x40",
36+
"scale" : "1x"
37+
},
38+
{
39+
"idiom" : "ipad",
40+
"size" : "40x40",
41+
"scale" : "2x"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "76x76",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "76x76",
51+
"scale" : "2x"
52+
}
53+
],
54+
"info" : {
55+
"version" : 1,
56+
"author" : "xcode"
57+
}
58+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"images" : [
3+
{
4+
"orientation" : "portrait",
5+
"idiom" : "iphone",
6+
"extent" : "full-screen",
7+
"minimum-system-version" : "7.0",
8+
"scale" : "2x"
9+
},
10+
{
11+
"orientation" : "portrait",
12+
"idiom" : "iphone",
13+
"subtype" : "retina4",
14+
"extent" : "full-screen",
15+
"minimum-system-version" : "7.0",
16+
"scale" : "2x"
17+
},
18+
{
19+
"orientation" : "portrait",
20+
"idiom" : "ipad",
21+
"extent" : "full-screen",
22+
"minimum-system-version" : "7.0",
23+
"scale" : "1x"
24+
},
25+
{
26+
"orientation" : "landscape",
27+
"idiom" : "ipad",
28+
"extent" : "full-screen",
29+
"minimum-system-version" : "7.0",
30+
"scale" : "1x"
31+
},
32+
{
33+
"orientation" : "portrait",
34+
"idiom" : "ipad",
35+
"extent" : "full-screen",
36+
"minimum-system-version" : "7.0",
37+
"scale" : "2x"
38+
},
39+
{
40+
"orientation" : "landscape",
41+
"idiom" : "ipad",
42+
"extent" : "full-screen",
43+
"minimum-system-version" : "7.0",
44+
"scale" : "2x"
45+
}
46+
],
47+
"info" : {
48+
"version" : 1,
49+
"author" : "xcode"
50+
}
51+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>${PRODUCT_NAME}</string>
9+
<key>CFBundleExecutable</key>
10+
<string>${EXECUTABLE_NAME}</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>kr.xoul.${PRODUCT_NAME:rfc1034identifier}</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>${PRODUCT_NAME}</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleSignature</key>
22+
<string>????</string>
23+
<key>CFBundleVersion</key>
24+
<string>1.0</string>
25+
<key>LSRequiresIPhoneOS</key>
26+
<true/>
27+
<key>UIRequiredDeviceCapabilities</key>
28+
<array>
29+
<string>armv7</string>
30+
</array>
31+
<key>UISupportedInterfaceOrientations</key>
32+
<array>
33+
<string>UIInterfaceOrientationPortrait</string>
34+
<string>UIInterfaceOrientationLandscapeLeft</string>
35+
<string>UIInterfaceOrientationLandscapeRight</string>
36+
</array>
37+
<key>UISupportedInterfaceOrientations~ipad</key>
38+
<array>
39+
<string>UIInterfaceOrientationPortrait</string>
40+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
41+
<string>UIInterfaceOrientationLandscapeLeft</string>
42+
<string>UIInterfaceOrientationLandscapeRight</string>
43+
</array>
44+
</dict>
45+
</plist>

0 commit comments

Comments
 (0)