Skip to content

Commit 12d3a77

Browse files
committed
添加OC版本的实现
1 parent 6e2edfb commit 12d3a77

63 files changed

Lines changed: 4778 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CustomTransition/CustomTransition-OC/CustomTransitions.xcodeproj/project.pbxproj

Lines changed: 516 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
The application delegate.
7+
*/
8+
9+
@import UIKit;
10+
11+
@interface AAPLAppDelegate : UIResponder <UIApplicationDelegate>
12+
13+
@property (nonatomic, strong) UIWindow *window;
14+
15+
@end
16+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
The application delegate.
7+
*/
8+
9+
#import "AAPLAppDelegate.h"
10+
11+
@implementation AAPLAppDelegate
12+
13+
//| ----------------------------------------------------------------------------
14+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
15+
{
16+
// Override point for customization after application launch.
17+
return YES;
18+
}
19+
20+
21+
//| ----------------------------------------------------------------------------
22+
#ifdef __IPHONE_9_0
23+
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
24+
#else
25+
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
26+
#endif
27+
{
28+
if ([UIDevice currentDevice].systemVersion.floatValue < 8.f)
29+
return UIInterfaceOrientationMaskPortrait;
30+
else
31+
return UIInterfaceOrientationMaskAll;
32+
}
33+
34+
@end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
A custom storyboard segue that loads its destination view controller from an
7+
external storyboard (named by the segue's identifier), then presents it
8+
modally.
9+
*/
10+
11+
@import UIKit;
12+
13+
@interface AAPLExternalStoryboardSegue : UIStoryboardSegue
14+
@end
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
A custom storyboard segue that loads its destination view controller from an
7+
external storyboard (named by the segue's identifier), then presents it
8+
modally.
9+
*/
10+
11+
#import "AAPLExternalStoryboardSegue.h"
12+
13+
// NOTE: iOS 9 introduces storyboard references which allow a segue to
14+
// target the initial scene in an external storyboard. If your
15+
// application targets iOS 9 and above, you should use storyboard
16+
// references rather than the technique shown here.
17+
18+
@implementation AAPLExternalStoryboardSegue
19+
20+
//| ----------------------------------------------------------------------------
21+
- (instancetype)initWithIdentifier:(NSString *)identifier source:(UIViewController *)source destination:(UIViewController *)destination
22+
{
23+
// Load the storyboard named by this segue's identifier.
24+
UIStoryboard *externalStoryboard = [UIStoryboard storyboardWithName:identifier bundle:[NSBundle bundleForClass:self.class]];
25+
26+
// Instantiate the storyboard's initial view controller.
27+
id initialViewController = [externalStoryboard instantiateInitialViewController];
28+
29+
return [super initWithIdentifier:identifier source:source destination:initialViewController];
30+
}
31+
32+
33+
//| ----------------------------------------------------------------------------
34+
- (void)perform
35+
{
36+
[self.sourceViewController presentViewController:self.destinationViewController animated:YES completion:NULL];
37+
}
38+
39+
@end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
Displays the list of examples.
7+
*/
8+
9+
@import UIKit;
10+
11+
@interface AAPLMenuViewController : UITableViewController
12+
@end
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
Abstract:
6+
Displays the list of examples.
7+
*/
8+
9+
#import "AAPLMenuViewController.h"
10+
11+
@implementation AAPLMenuViewController
12+
13+
//| ----------------------------------------------------------------------------
14+
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
15+
{
16+
// Certain examples are only supported on iOS 8 and later.
17+
if ([UIDevice currentDevice].systemVersion.floatValue < 8.f)
18+
{
19+
NSArray *iOS7Examples = @[@"CrossDissolve", @"Dynamics", @"Swipe", @"Checkerboard", @"Slide"];
20+
21+
if ([iOS7Examples containsObject:identifier] == NO) {
22+
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
23+
24+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Can not load example." message:@"This example requires iOS 8 or later." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
25+
[alert show];
26+
27+
return NO;
28+
}
29+
}
30+
31+
return YES;
32+
}
33+
34+
35+
//| ----------------------------------------------------------------------------
36+
- (IBAction)unwindToMenuViewController:(UIStoryboardSegue*)sender
37+
{ }
38+
39+
@end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
Copyright (C) 2016 Apple Inc. All Rights Reserved.
3+
See LICENSE.txt for this sample’s licensing information
4+
5+
*/
6+
7+
@import UIKit;
8+
9+
@interface AAPLAdaptivePresentationController : UIPresentationController <UIViewControllerTransitioningDelegate>
10+
@end

0 commit comments

Comments
 (0)