Skip to content

Commit 26a606c

Browse files
Added storyboard transition sample code
1 parent 04e7247 commit 26a606c

14 files changed

+813
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
ABE420C015BE431A00E3258E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABE420BF15BE431A00E3258E /* UIKit.framework */; };
11+
ABE420C215BE431A00E3258E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABE420C115BE431A00E3258E /* Foundation.framework */; };
12+
ABE420C415BE431A00E3258E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABE420C315BE431A00E3258E /* CoreGraphics.framework */; };
13+
ABE420CA15BE431A00E3258E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ABE420C815BE431A00E3258E /* InfoPlist.strings */; };
14+
ABE420CC15BE431A00E3258E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ABE420CB15BE431A00E3258E /* main.m */; };
15+
ABE420D015BE431A00E3258E /* MKAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ABE420CF15BE431A00E3258E /* MKAppDelegate.m */; };
16+
ABE420D315BE431A00E3258E /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ABE420D115BE431A00E3258E /* MainStoryboard.storyboard */; };
17+
ABE420D615BE431A00E3258E /* MKMasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABE420D515BE431A00E3258E /* MKMasterViewController.m */; };
18+
ABE420D915BE431A00E3258E /* MKDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABE420D815BE431A00E3258E /* MKDetailViewController.m */; };
19+
ABE420E115BE434600E3258E /* CustomSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = ABE420E015BE434600E3258E /* CustomSegue.m */; };
20+
ABE420E315BE444A00E3258E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABE420E215BE444A00E3258E /* QuartzCore.framework */; };
21+
/* End PBXBuildFile section */
22+
23+
/* Begin PBXFileReference section */
24+
ABE420BB15BE431A00E3258E /* StoryboardTransition.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StoryboardTransition.app; sourceTree = BUILT_PRODUCTS_DIR; };
25+
ABE420BF15BE431A00E3258E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
26+
ABE420C115BE431A00E3258E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
27+
ABE420C315BE431A00E3258E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
28+
ABE420C715BE431A00E3258E /* StoryboardTransition-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "StoryboardTransition-Info.plist"; sourceTree = "<group>"; };
29+
ABE420C915BE431A00E3258E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
30+
ABE420CB15BE431A00E3258E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
31+
ABE420CD15BE431A00E3258E /* StoryboardTransition-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "StoryboardTransition-Prefix.pch"; sourceTree = "<group>"; };
32+
ABE420CE15BE431A00E3258E /* MKAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MKAppDelegate.h; sourceTree = "<group>"; };
33+
ABE420CF15BE431A00E3258E /* MKAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MKAppDelegate.m; sourceTree = "<group>"; };
34+
ABE420D215BE431A00E3258E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
35+
ABE420D415BE431A00E3258E /* MKMasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MKMasterViewController.h; sourceTree = "<group>"; };
36+
ABE420D515BE431A00E3258E /* MKMasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MKMasterViewController.m; sourceTree = "<group>"; };
37+
ABE420D715BE431A00E3258E /* MKDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MKDetailViewController.h; sourceTree = "<group>"; };
38+
ABE420D815BE431A00E3258E /* MKDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MKDetailViewController.m; sourceTree = "<group>"; };
39+
ABE420DF15BE434600E3258E /* CustomSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomSegue.h; sourceTree = "<group>"; };
40+
ABE420E015BE434600E3258E /* CustomSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomSegue.m; sourceTree = "<group>"; };
41+
ABE420E215BE444A00E3258E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
42+
/* End PBXFileReference section */
43+
44+
/* Begin PBXFrameworksBuildPhase section */
45+
ABE420B815BE431A00E3258E /* Frameworks */ = {
46+
isa = PBXFrameworksBuildPhase;
47+
buildActionMask = 2147483647;
48+
files = (
49+
ABE420E315BE444A00E3258E /* QuartzCore.framework in Frameworks */,
50+
ABE420C015BE431A00E3258E /* UIKit.framework in Frameworks */,
51+
ABE420C215BE431A00E3258E /* Foundation.framework in Frameworks */,
52+
ABE420C415BE431A00E3258E /* CoreGraphics.framework in Frameworks */,
53+
);
54+
runOnlyForDeploymentPostprocessing = 0;
55+
};
56+
/* End PBXFrameworksBuildPhase section */
57+
58+
/* Begin PBXGroup section */
59+
ABE420B015BE431900E3258E = {
60+
isa = PBXGroup;
61+
children = (
62+
ABE420C515BE431A00E3258E /* StoryboardTransition */,
63+
ABE420BE15BE431A00E3258E /* Frameworks */,
64+
ABE420BC15BE431A00E3258E /* Products */,
65+
);
66+
sourceTree = "<group>";
67+
};
68+
ABE420BC15BE431A00E3258E /* Products */ = {
69+
isa = PBXGroup;
70+
children = (
71+
ABE420BB15BE431A00E3258E /* StoryboardTransition.app */,
72+
);
73+
name = Products;
74+
sourceTree = "<group>";
75+
};
76+
ABE420BE15BE431A00E3258E /* Frameworks */ = {
77+
isa = PBXGroup;
78+
children = (
79+
ABE420E215BE444A00E3258E /* QuartzCore.framework */,
80+
ABE420BF15BE431A00E3258E /* UIKit.framework */,
81+
ABE420C115BE431A00E3258E /* Foundation.framework */,
82+
ABE420C315BE431A00E3258E /* CoreGraphics.framework */,
83+
);
84+
name = Frameworks;
85+
sourceTree = "<group>";
86+
};
87+
ABE420C515BE431A00E3258E /* StoryboardTransition */ = {
88+
isa = PBXGroup;
89+
children = (
90+
ABE420CE15BE431A00E3258E /* MKAppDelegate.h */,
91+
ABE420CF15BE431A00E3258E /* MKAppDelegate.m */,
92+
ABE420D115BE431A00E3258E /* MainStoryboard.storyboard */,
93+
ABE420D415BE431A00E3258E /* MKMasterViewController.h */,
94+
ABE420D515BE431A00E3258E /* MKMasterViewController.m */,
95+
ABE420D715BE431A00E3258E /* MKDetailViewController.h */,
96+
ABE420D815BE431A00E3258E /* MKDetailViewController.m */,
97+
ABE420C615BE431A00E3258E /* Supporting Files */,
98+
ABE420DF15BE434600E3258E /* CustomSegue.h */,
99+
ABE420E015BE434600E3258E /* CustomSegue.m */,
100+
);
101+
path = StoryboardTransition;
102+
sourceTree = "<group>";
103+
};
104+
ABE420C615BE431A00E3258E /* Supporting Files */ = {
105+
isa = PBXGroup;
106+
children = (
107+
ABE420C715BE431A00E3258E /* StoryboardTransition-Info.plist */,
108+
ABE420C815BE431A00E3258E /* InfoPlist.strings */,
109+
ABE420CB15BE431A00E3258E /* main.m */,
110+
ABE420CD15BE431A00E3258E /* StoryboardTransition-Prefix.pch */,
111+
);
112+
name = "Supporting Files";
113+
sourceTree = "<group>";
114+
};
115+
/* End PBXGroup section */
116+
117+
/* Begin PBXNativeTarget section */
118+
ABE420BA15BE431A00E3258E /* StoryboardTransition */ = {
119+
isa = PBXNativeTarget;
120+
buildConfigurationList = ABE420DC15BE431A00E3258E /* Build configuration list for PBXNativeTarget "StoryboardTransition" */;
121+
buildPhases = (
122+
ABE420B715BE431A00E3258E /* Sources */,
123+
ABE420B815BE431A00E3258E /* Frameworks */,
124+
ABE420B915BE431A00E3258E /* Resources */,
125+
);
126+
buildRules = (
127+
);
128+
dependencies = (
129+
);
130+
name = StoryboardTransition;
131+
productName = StoryboardTransition;
132+
productReference = ABE420BB15BE431A00E3258E /* StoryboardTransition.app */;
133+
productType = "com.apple.product-type.application";
134+
};
135+
/* End PBXNativeTarget section */
136+
137+
/* Begin PBXProject section */
138+
ABE420B215BE431900E3258E /* Project object */ = {
139+
isa = PBXProject;
140+
attributes = {
141+
CLASSPREFIX = MK;
142+
LastUpgradeCheck = 0430;
143+
ORGANIZATIONNAME = "Steinlogic Consulting and Training Pte Ltd";
144+
};
145+
buildConfigurationList = ABE420B515BE431900E3258E /* Build configuration list for PBXProject "StoryboardTransition" */;
146+
compatibilityVersion = "Xcode 3.2";
147+
developmentRegion = English;
148+
hasScannedForEncodings = 0;
149+
knownRegions = (
150+
en,
151+
);
152+
mainGroup = ABE420B015BE431900E3258E;
153+
productRefGroup = ABE420BC15BE431A00E3258E /* Products */;
154+
projectDirPath = "";
155+
projectRoot = "";
156+
targets = (
157+
ABE420BA15BE431A00E3258E /* StoryboardTransition */,
158+
);
159+
};
160+
/* End PBXProject section */
161+
162+
/* Begin PBXResourcesBuildPhase section */
163+
ABE420B915BE431A00E3258E /* Resources */ = {
164+
isa = PBXResourcesBuildPhase;
165+
buildActionMask = 2147483647;
166+
files = (
167+
ABE420CA15BE431A00E3258E /* InfoPlist.strings in Resources */,
168+
ABE420D315BE431A00E3258E /* MainStoryboard.storyboard in Resources */,
169+
);
170+
runOnlyForDeploymentPostprocessing = 0;
171+
};
172+
/* End PBXResourcesBuildPhase section */
173+
174+
/* Begin PBXSourcesBuildPhase section */
175+
ABE420B715BE431A00E3258E /* Sources */ = {
176+
isa = PBXSourcesBuildPhase;
177+
buildActionMask = 2147483647;
178+
files = (
179+
ABE420CC15BE431A00E3258E /* main.m in Sources */,
180+
ABE420D015BE431A00E3258E /* MKAppDelegate.m in Sources */,
181+
ABE420D615BE431A00E3258E /* MKMasterViewController.m in Sources */,
182+
ABE420D915BE431A00E3258E /* MKDetailViewController.m in Sources */,
183+
ABE420E115BE434600E3258E /* CustomSegue.m in Sources */,
184+
);
185+
runOnlyForDeploymentPostprocessing = 0;
186+
};
187+
/* End PBXSourcesBuildPhase section */
188+
189+
/* Begin PBXVariantGroup section */
190+
ABE420C815BE431A00E3258E /* InfoPlist.strings */ = {
191+
isa = PBXVariantGroup;
192+
children = (
193+
ABE420C915BE431A00E3258E /* en */,
194+
);
195+
name = InfoPlist.strings;
196+
sourceTree = "<group>";
197+
};
198+
ABE420D115BE431A00E3258E /* MainStoryboard.storyboard */ = {
199+
isa = PBXVariantGroup;
200+
children = (
201+
ABE420D215BE431A00E3258E /* en */,
202+
);
203+
name = MainStoryboard.storyboard;
204+
sourceTree = "<group>";
205+
};
206+
/* End PBXVariantGroup section */
207+
208+
/* Begin XCBuildConfiguration section */
209+
ABE420DA15BE431A00E3258E /* Debug */ = {
210+
isa = XCBuildConfiguration;
211+
buildSettings = {
212+
ALWAYS_SEARCH_USER_PATHS = NO;
213+
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
214+
CLANG_ENABLE_OBJC_ARC = YES;
215+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
216+
COPY_PHASE_STRIP = NO;
217+
GCC_C_LANGUAGE_STANDARD = gnu99;
218+
GCC_DYNAMIC_NO_PIC = NO;
219+
GCC_OPTIMIZATION_LEVEL = 0;
220+
GCC_PREPROCESSOR_DEFINITIONS = (
221+
"DEBUG=1",
222+
"$(inherited)",
223+
);
224+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
225+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
226+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
227+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
228+
GCC_WARN_UNUSED_VARIABLE = YES;
229+
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
230+
SDKROOT = iphoneos;
231+
};
232+
name = Debug;
233+
};
234+
ABE420DB15BE431A00E3258E /* Release */ = {
235+
isa = XCBuildConfiguration;
236+
buildSettings = {
237+
ALWAYS_SEARCH_USER_PATHS = NO;
238+
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
239+
CLANG_ENABLE_OBJC_ARC = YES;
240+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
241+
COPY_PHASE_STRIP = YES;
242+
GCC_C_LANGUAGE_STANDARD = gnu99;
243+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
244+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
245+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
246+
GCC_WARN_UNUSED_VARIABLE = YES;
247+
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
248+
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
249+
SDKROOT = iphoneos;
250+
VALIDATE_PRODUCT = YES;
251+
};
252+
name = Release;
253+
};
254+
ABE420DD15BE431A00E3258E /* Debug */ = {
255+
isa = XCBuildConfiguration;
256+
buildSettings = {
257+
GCC_PRECOMPILE_PREFIX_HEADER = YES;
258+
GCC_PREFIX_HEADER = "StoryboardTransition/StoryboardTransition-Prefix.pch";
259+
INFOPLIST_FILE = "StoryboardTransition/StoryboardTransition-Info.plist";
260+
PRODUCT_NAME = "$(TARGET_NAME)";
261+
WRAPPER_EXTENSION = app;
262+
};
263+
name = Debug;
264+
};
265+
ABE420DE15BE431A00E3258E /* Release */ = {
266+
isa = XCBuildConfiguration;
267+
buildSettings = {
268+
GCC_PRECOMPILE_PREFIX_HEADER = YES;
269+
GCC_PREFIX_HEADER = "StoryboardTransition/StoryboardTransition-Prefix.pch";
270+
INFOPLIST_FILE = "StoryboardTransition/StoryboardTransition-Info.plist";
271+
PRODUCT_NAME = "$(TARGET_NAME)";
272+
WRAPPER_EXTENSION = app;
273+
};
274+
name = Release;
275+
};
276+
/* End XCBuildConfiguration section */
277+
278+
/* Begin XCConfigurationList section */
279+
ABE420B515BE431900E3258E /* Build configuration list for PBXProject "StoryboardTransition" */ = {
280+
isa = XCConfigurationList;
281+
buildConfigurations = (
282+
ABE420DA15BE431A00E3258E /* Debug */,
283+
ABE420DB15BE431A00E3258E /* Release */,
284+
);
285+
defaultConfigurationIsVisible = 0;
286+
defaultConfigurationName = Release;
287+
};
288+
ABE420DC15BE431A00E3258E /* Build configuration list for PBXNativeTarget "StoryboardTransition" */ = {
289+
isa = XCConfigurationList;
290+
buildConfigurations = (
291+
ABE420DD15BE431A00E3258E /* Debug */,
292+
ABE420DE15BE431A00E3258E /* Release */,
293+
);
294+
defaultConfigurationIsVisible = 0;
295+
};
296+
/* End XCConfigurationList section */
297+
};
298+
rootObject = ABE420B215BE431900E3258E /* Project object */;
299+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// CustomSegue.h
3+
// StoryboardTransition
4+
//
5+
// Created by Mugunth Kumar on 24/7/12.
6+
// Copyright (c) 2012 Steinlogic Consulting and Training Pte Ltd. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface CustomSegue : UIStoryboardSegue
12+
13+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//
2+
// CustomSegue.m
3+
// StoryboardTransition
4+
//
5+
// Created by Mugunth Kumar on 24/7/12.
6+
// Copyright (c) 2012 Steinlogic Consulting and Training Pte Ltd. All rights reserved.
7+
//
8+
9+
#import "CustomSegue.h"
10+
11+
@implementation CustomSegue
12+
13+
- (void) perform {
14+
15+
UIViewController *src = (UIViewController *)self.sourceViewController;
16+
UIViewController *dest = (UIViewController *)self.destinationViewController;
17+
18+
CGRect f = src.view.frame;
19+
CGRect originalSourceRect = src.view.frame;
20+
f.origin.y = f.size.height;
21+
22+
[UIView animateWithDuration:0.3 animations:^{
23+
src.view.frame = f;
24+
25+
} completion:^(BOOL finished){
26+
src.view.alpha = 0;
27+
dest.view.frame = f;
28+
dest.view.alpha = 0.0f;
29+
[[src.view superview] addSubview:dest.view];
30+
[UIView animateWithDuration:0.3 animations:^{
31+
32+
dest.view.frame = originalSourceRect;
33+
dest.view.alpha = 1.0f;
34+
} completion:^(BOOL finished) {
35+
36+
[dest.view removeFromSuperview];
37+
src.view.alpha = 1.0f;
38+
[src.navigationController pushViewController:dest animated:NO];
39+
}];
40+
}];
41+
}
42+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// MKAppDelegate.h
3+
// StoryboardTransition
4+
//
5+
// Created by Mugunth Kumar on 24/7/12.
6+
// Copyright (c) 2012 Steinlogic Consulting and Training Pte Ltd. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface MKAppDelegate : UIResponder <UIApplicationDelegate>
12+
13+
@property (strong, nonatomic) UIWindow *window;
14+
15+
@end

0 commit comments

Comments
 (0)