├── icon.png
├── MagicTransition.gif
├── .travis.yml
├── MagicTransition
├── Images.xcassets
│ ├── 1.imageset
│ │ ├── 1.png
│ │ └── Contents.json
│ ├── 2.imageset
│ │ ├── 2.png
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── AppDelegate.h
├── main.m
├── ThirdViewController.h
├── FirstViewController.h
├── SecondViewController.h
├── ThirdViewController.m
├── Info.plist
├── FirstViewController.m
├── SecondViewController.m
├── AppDelegate.m
├── Base.lproj
│ └── LaunchScreen.xib
├── FirstViewController.xib
├── ThirdViewController.xib
└── SecondViewController.xib
├── Demo.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── project.pbxproj
├── .gitignore
├── BCMagicTransition.podspec
├── BCMagicTransition
├── BCMagicTransition.h
├── UIViewController+BCMagicTransition.h
├── BCMagicTransition.m
└── UIViewController+BCMagicTransition.m
├── LICENSE
└── README.md
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boycechang/BCMagicTransition/HEAD/icon.png
--------------------------------------------------------------------------------
/MagicTransition.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boycechang/BCMagicTransition/HEAD/MagicTransition.gif
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | script: xcodebuild -project Demo.xcodeproj -target Demo -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
3 |
--------------------------------------------------------------------------------
/MagicTransition/Images.xcassets/1.imageset/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boycechang/BCMagicTransition/HEAD/MagicTransition/Images.xcassets/1.imageset/1.png
--------------------------------------------------------------------------------
/MagicTransition/Images.xcassets/2.imageset/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boycechang/BCMagicTransition/HEAD/MagicTransition/Images.xcassets/2.imageset/2.png
--------------------------------------------------------------------------------
/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MagicTransition/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // MagicTransition
4 | //
5 | // Created by Boyce on 10/31/14.
6 | // Copyright (c) 2014 Boyce. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 |
17 | @end
18 |
19 |
--------------------------------------------------------------------------------
/MagicTransition/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // MagicTransition
4 | //
5 | // Created by Boyce on 10/31/14.
6 | // Copyright (c) 2014 Boyce. 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 |
--------------------------------------------------------------------------------
/MagicTransition/Images.xcassets/1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x",
10 | "filename" : "1.png"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/MagicTransition/Images.xcassets/2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x",
10 | "filename" : "2.png"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/MagicTransition/ThirdViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ThirdViewController.h
3 | // Demo
4 | //
5 | // Created by Boyce on 4/8/15.
6 | // Copyright (c) 2015 Boyce. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "UIViewController+BCMagicTransition.h"
11 |
12 | @interface ThirdViewController : UIViewController
13 |
14 | @property (nonatomic, weak) IBOutlet UILabel *label1;
15 | @property (nonatomic, weak) IBOutlet UIImageView *imageView1;
16 | @property (nonatomic, weak) IBOutlet UIImageView *imageView2;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/MagicTransition/FirstViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FirstViewController.h
3 | // MagicTransition
4 | //
5 | // Created by Boyce on 10/31/14.
6 | // Copyright (c) 2014 Boyce. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "UIViewController+BCMagicTransition.h"
11 |
12 | @interface FirstViewController : UIViewController
13 |
14 | @property (nonatomic, weak) IBOutlet UILabel *label1;
15 | @property (nonatomic, weak) IBOutlet UIImageView *imageView1;
16 | @property (nonatomic, weak) IBOutlet UIImageView *imageView2;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/MagicTransition/SecondViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.h
3 | // MagicTransition
4 | //
5 | // Created by Boyce on 10/31/14.
6 | // Copyright (c) 2014 Boyce. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "UIViewController+BCMagicTransition.h"
11 |
12 | @interface SecondViewController : UIViewController
13 |
14 | @property (nonatomic, weak) IBOutlet UILabel *label1;
15 | @property (nonatomic, weak) IBOutlet UIImageView *imageView1;
16 | @property (nonatomic, weak) IBOutlet UIImageView *imageView2;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/BCMagicTransition.podspec:
--------------------------------------------------------------------------------
1 |
2 | Pod::Spec.new do |s|
3 | s.name = 'BCMagicTransition'
4 | s.version = '1.0.8'
5 | s.license = 'MIT'
6 | s.summary = "A MagicMove Style Custom UIViewController Transiton."
7 | s.homepage = 'https://github.com/boycechang/BCMagicTransition'
8 | s.authors = { 'Boyce Chang' =>
9 | 'boyce.chang89@gmail.com' }
10 | s.social_media_url = "https://github.com/boycechang"
11 | s.source = { :git => 'https://github.com/boycechang/BCMagicTransition.git', :tag => '1.0.8' }
12 | s.source_files = 'BCMagicTransition'
13 | s.ios.deployment_target = '7.0'
14 | s.frameworks = 'UIKit'
15 | s.requires_arc = true
16 | end
17 |
--------------------------------------------------------------------------------
/MagicTransition/ThirdViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ThirdViewController.m
3 | // Demo
4 | //
5 | // Created by Boyce on 4/8/15.
6 | // Copyright (c) 2015 Boyce. All rights reserved.
7 | //
8 |
9 | #import "ThirdViewController.h"
10 |
11 | @interface ThirdViewController ()
12 |
13 | @end
14 |
15 | @implementation ThirdViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | self.title = @"Third VC";
20 | // Do any additional setup after loading the view from its nib.
21 | }
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/MagicTransition/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 | }
--------------------------------------------------------------------------------
/BCMagicTransition/BCMagicTransition.h:
--------------------------------------------------------------------------------
1 | //
2 | // BCMagicTransition.h
3 | // BCMagicTransition
4 | //
5 | // Created by Boyce Chang on 10/21/14.
6 | // Copyright (c) 2014 Boyce Chang. All rights reserved.
7 | //
8 |
9 |
10 |
11 | #import
12 | #import
13 |
14 | #define DEFAULT_TRANSITON_DURATION 0.3
15 | #define DEFAULT_TRANSITON_DELAY 0.0
16 | #define DEFAULT_TRANSITON_DAMPING 0.8
17 | #define DEFAULT_TRANSITON_VELOCITY 1.0
18 |
19 | @interface BCMagicTransition : NSObject
20 |
21 | @property (nonatomic, assign) BOOL isPush;
22 | @property (nonatomic, assign) BOOL isMagic;
23 |
24 | @property (nonatomic, assign) NSTimeInterval duration;
25 | @property (nonatomic, assign) NSTimeInterval delay;
26 | @property (nonatomic, assign) CGFloat damping;
27 | @property (nonatomic, assign) CGFloat velocity;
28 |
29 | @property (nonatomic, strong) NSArray *fromViews;
30 | @property (nonatomic, strong) NSArray *toViews;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014, Boyce Chang
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/MagicTransition/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | MagicMove
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 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/MagicTransition/FirstViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // FirstViewController.m
3 | // MagicTransition
4 | //
5 | // Created by Boyce on 10/31/14.
6 | // Copyright (c) 2014 Boyce. All rights reserved.
7 | //
8 |
9 | #import "FirstViewController.h"
10 | #import "SecondViewController.h"
11 |
12 | @interface FirstViewController ()
13 |
14 | @end
15 |
16 | @implementation FirstViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | self.title = @"First VC";
21 | // Do any additional setup after loading the view from its nib.
22 | }
23 |
24 | - (void)didReceiveMemoryWarning {
25 | [super didReceiveMemoryWarning];
26 | // Dispose of any resources that can be recreated.
27 | }
28 |
29 | - (IBAction)push:(id)sender {
30 | SecondViewController *secondVC = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
31 |
32 | // preload views to the memory
33 | [secondVC view];
34 |
35 | [self pushViewController:secondVC
36 | fromViews:@[self.imageView1, self.imageView2, self.label1]
37 | toViews:@[secondVC.imageView1, secondVC.imageView2, secondVC.label1]
38 | duration:0.5];
39 | }
40 |
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/BCMagicTransition/UIViewController+BCMagicTransition.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+BCMagicTransition.h
3 | // Demo
4 | //
5 | // Created by Boyce Chang on 6/4/15.
6 | // Copyright (c) 2015 Boyce Chang. All rights reserved.
7 | //
8 |
9 |
10 | // Conform to this protocol on a viewController which utilizes BCMagicTransition. ViewControllers which don't will not be affected.
11 |
12 | #import
13 | #import
14 |
15 | @class BCMagicTransition;
16 |
17 | @protocol BCMagicTransitionProtocol
18 |
19 | @end
20 |
21 | @interface UIViewController (BCMagicTransition)
22 |
23 | @property (nonatomic, strong) UIPercentDrivenInteractiveTransition *interactivePopTransition;
24 | @property (nonatomic, strong) BCMagicTransition *popTransit;
25 | @property (nonatomic, strong) BCMagicTransition *pushTransit;
26 |
27 | - (void)pushViewController:(UIViewController *)viewController
28 | fromView:(UIView *)fromView
29 | toView:(UIView *)toView
30 | duration:(NSTimeInterval)duration;
31 |
32 | - (void)pushViewController:(UIViewController *)viewController
33 | fromViews:(NSArray *)fromViews
34 | toViews:(NSArray *)toViews
35 | duration:(NSTimeInterval)duration;
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/MagicTransition/SecondViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // SecondViewController.m
3 | // MagicTransition
4 | //
5 | // Created by Boyce on 10/31/14.
6 | // Copyright (c) 2014 Boyce. All rights reserved.
7 | //
8 |
9 | #import "SecondViewController.h"
10 | #import "ThirdViewController.h"
11 |
12 | @interface SecondViewController ()
13 | @property (nonatomic, strong) UIPercentDrivenInteractiveTransition *percentDrivenTransition;
14 | @end
15 |
16 | @implementation SecondViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | self.title = @"Second VC";
21 | }
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 | - (IBAction)push:(id)sender {
29 | ThirdViewController *thirdVC = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil];
30 |
31 | // preload views to the memory
32 | [thirdVC view];
33 |
34 | // setup fromviews array and toviews array
35 | NSArray *fromViews = [NSArray arrayWithObjects:self.imageView1, self.imageView2, self.label1, nil];
36 | NSArray *toViews = [NSArray arrayWithObjects:thirdVC.imageView1, thirdVC.imageView2, thirdVC.label1, nil];
37 |
38 | [self pushViewController:thirdVC fromViews:fromViews toViews:toViews duration:1.0];
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | BCMagicTransition [](https://travis-ci.org/boycechang/BCMagicTransition)  ) 
4 | =====================
5 |
6 | 
7 |
8 |
9 | **A MagicMove Style Custom UIViewController Transiton**
10 |
11 | **Version 1.0.5**
12 |
13 |
14 |
15 | ##Adding BCMagicTransition to your project
16 |
17 | #### Requirements
18 |
19 | * ARC only; iOS 7.0+
20 |
21 | #### Get it as:
22 | ##### 1) source files
23 |
24 | 1. Download the BCMagicTransition repository as a zip file or clone it
25 | 2. Copy the BCMagicTransition files into your Xcode project
26 |
27 | ##### 2) via Cocoa pods
28 |
29 | BCMagicTransition is available on [CocoaPods](http://cocoapods.org). Just add the following to your project Podfile:
30 |
31 | ```ruby
32 | pod 'BCMagicTransition'
33 | ```
34 |
35 | If you want to read more about CocoaPods, have a look at [this short tutorial](http://www.raywenderlich.com/12139/introduction-to-cocoapods).
36 |
37 |
38 | ##Basic usage
39 | ```objective-c
40 | #import "UIViewController+BCMagicTransition.h"
41 |
42 | @interface MyViewController :
43 |
44 |
45 | - (void)push
46 | {
47 | ... ...
48 |
49 | [self pushViewController:secondVC fromViews:fromViews toViews:toViews duration:0.3];
50 | }
51 |
52 | ```
53 |
54 |
55 | ##Misc
56 |
57 | Author: BoyceChang
58 |
59 | If you like BCMagicTransition and use it, could you please:
60 |
61 | * star this repo
62 | * send me some feedback. Thanks!
63 |
64 | #### License
65 | This code is distributed under the terms and conditions of the MIT license.
66 |
67 | #### Contribution guidelines
68 |
69 | If you are fixing a bug you discovered, please add also a unit test so I know how exactly to reproduce the bug before merging.
70 |
--------------------------------------------------------------------------------
/MagicTransition/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // MagicTransition
4 | //
5 | // Created by Boyce on 10/31/14.
6 | // Copyright (c) 2014 Boyce. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "FirstViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | // Override point for customization after application launch.
21 |
22 | FirstViewController *firstVC = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
23 | UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:firstVC];
24 |
25 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
26 | self.window.rootViewController = navVC;
27 | [self.window makeKeyAndVisible];
28 |
29 | return YES;
30 | }
31 |
32 | - (void)applicationWillResignActive:(UIApplication *)application {
33 | // 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.
34 | // 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.
35 | }
36 |
37 | - (void)applicationDidEnterBackground:(UIApplication *)application {
38 | // 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.
39 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
40 | }
41 |
42 | - (void)applicationWillEnterForeground:(UIApplication *)application {
43 | // 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.
44 | }
45 |
46 | - (void)applicationDidBecomeActive:(UIApplication *)application {
47 | // 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.
48 | }
49 |
50 | - (void)applicationWillTerminate:(UIApplication *)application {
51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
52 | // Saves changes in the application's managed object context before the application terminates.
53 | }
54 |
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/MagicTransition/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/MagicTransition/FirstViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/MagicTransition/ThirdViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/MagicTransition/SecondViewController.xib:
--------------------------------------------------------------------------------
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 |
48 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/BCMagicTransition/BCMagicTransition.m:
--------------------------------------------------------------------------------
1 | //
2 | // BCMagicTransition.m
3 | // BCMagicTransition
4 | //
5 | // Created by Xaiobo Zhang on 10/21/14.
6 | // Copyright (c) 2014 Xaiobo Zhang. All rights reserved.
7 | //
8 |
9 | #import "BCMagicTransition.h"
10 |
11 | @interface BCMagicTransition ()
12 |
13 | @end
14 |
15 | @implementation BCMagicTransition
16 |
17 | #pragma mark - UIViewControllerAnimatedTransitioning
18 |
19 | - (instancetype)init {
20 | self = [super init];
21 |
22 | if (self) {
23 | _delay = DEFAULT_TRANSITON_DELAY;
24 | _duration = DEFAULT_TRANSITON_DURATION;
25 | _damping = DEFAULT_TRANSITON_DAMPING;
26 | _velocity = DEFAULT_TRANSITON_VELOCITY;
27 | }
28 |
29 | return self;
30 | }
31 |
32 | - (NSTimeInterval)transitionDuration:(id )transitionContext {
33 | return self.duration;
34 | }
35 |
36 | - (void)animateTransition:(id )transitionContext {
37 | UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
38 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
39 | UIView *containerView = [transitionContext containerView];
40 |
41 | if (self.isMagic) {
42 | [self magicAnimationFromViewController:fromVC toViewController:toVC containerView:containerView duration:self.duration transitionContext:transitionContext];
43 | } else {
44 | [self defaultAnimationFromViewController:fromVC toViewController:toVC containerView:containerView duration:self.duration transitionContext:transitionContext];
45 | }
46 | }
47 |
48 |
49 | #pragma mark - private
50 |
51 | - (UIImage *)getImageFromView:(UIView *)view {
52 | UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.0);
53 | [view.layer renderInContext:UIGraphicsGetCurrentContext()];
54 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
55 | UIGraphicsEndImageContext();
56 | return image;
57 | }
58 |
59 |
60 | - (void)defaultAnimationFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController containerView:(UIView *)containerView duration:(NSTimeInterval)duration transitionContext:(id )transitionContext {
61 | float deviation = (self.isPush) ? 1.0f : -1.0f;
62 |
63 | CGRect newFrame = toViewController.view.frame;
64 | newFrame.origin.x += newFrame.size.width*deviation;
65 | toViewController.view.frame = newFrame;
66 | [containerView addSubview:toViewController.view];
67 | [containerView addSubview:fromViewController.view];
68 |
69 | [UIView animateWithDuration:duration animations:^{
70 | CGRect animationFrame = toViewController.view.frame;
71 | animationFrame.origin.x -= animationFrame.size.width*deviation;
72 | toViewController.view.frame = animationFrame;
73 |
74 | animationFrame = fromViewController.view.frame;
75 | animationFrame.origin.x -= animationFrame.size.width*deviation;
76 | fromViewController.view.frame = animationFrame;
77 | } completion:^(BOOL finished) {
78 | [fromViewController.view removeFromSuperview];
79 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
80 | }];
81 |
82 | }
83 |
84 | - (void)magicAnimationFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController containerView:(UIView *)containerView duration:(NSTimeInterval)duration transitionContext:(id )transitionContext {
85 |
86 | NSAssert([self.fromViews count] == [self.toViews count], @"*** The count of fromviews and toviews must be the same! ***");
87 |
88 | NSMutableArray *fromViewSnapshotArray = [[NSMutableArray alloc] init];
89 | for (UIView *fromView in self.fromViews) {
90 | UIImageView *fromViewSnapshot = [[UIImageView alloc] initWithImage:[self getImageFromView:fromView]];
91 | fromViewSnapshot.frame = [containerView convertRect:fromView.frame fromView:fromView.superview];
92 | [fromViewSnapshotArray addObject:fromViewSnapshot];
93 | fromView.hidden = YES;
94 | }
95 |
96 | for (UIView *toView in self.toViews) {
97 | toView.hidden = YES;
98 | }
99 |
100 | toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController];
101 | toViewController.view.alpha = 0;
102 | [containerView addSubview:toViewController.view];
103 |
104 | for (NSUInteger i = [fromViewSnapshotArray count]; i > 0; i--) {
105 | [containerView addSubview:[fromViewSnapshotArray objectAtIndex:i - 1]];
106 | }
107 |
108 | [containerView layoutIfNeeded];
109 | [UIView animateWithDuration:duration
110 | delay:_delay
111 | usingSpringWithDamping:_damping
112 | initialSpringVelocity:_velocity
113 | options:UIViewAnimationOptionCurveEaseInOut
114 | animations:^{
115 | toViewController.view.alpha = 1.0;
116 | for (NSUInteger i = 0; i < [self.fromViews count]; i++) {
117 | UIView *toView = [self.toViews objectAtIndex:i];
118 | UIView *fromViewSnapshot = [fromViewSnapshotArray objectAtIndex:i];
119 | CGRect frame = [containerView convertRect:toView.frame fromView:toView.superview];
120 | fromViewSnapshot.frame = frame;
121 | }
122 | } completion:^(BOOL finished) {
123 | for (NSUInteger i = 0; i < [self.fromViews count]; i++) {
124 | UIView *toView = [self.toViews objectAtIndex:i];
125 | UIView *fromView = [self.fromViews objectAtIndex:i];
126 | toView.hidden = NO;
127 | fromView.hidden = NO;
128 |
129 | UIView *fromViewSnapshot = [fromViewSnapshotArray objectAtIndex:i];
130 | [fromViewSnapshot removeFromSuperview];
131 | }
132 |
133 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled];
134 | }];
135 | }
136 |
137 | @end
138 |
--------------------------------------------------------------------------------
/BCMagicTransition/UIViewController+BCMagicTransition.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+BCMagicTransition.m
3 | // Demo
4 | //
5 | // Created by Nikhil Nigade on 6/4/15.
6 | // Copyright (c) 2015 Boyce. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "BCMagicTransition.h"
11 |
12 | #import "UIViewController+BCMagicTransition.h"
13 |
14 | static char kPopTransit;
15 | static char kPushTransit;
16 | static char kInteractivePopTransition;
17 |
18 | @implementation UIViewController (BCMagicTransition)
19 |
20 | @dynamic popTransit;
21 | @dynamic pushTransit;
22 | @dynamic interactivePopTransition;
23 |
24 |
25 | #pragma mark - Swizzled Methods
26 |
27 | - (void)bc_viewDidAppear:(BOOL)animated {
28 | [self bc_viewDidAppear:animated];
29 |
30 | // Set outself as the navigation controller's delegate so we're asked for a transitioning object
31 | if (self.popTransit) {
32 | self.navigationController.delegate = self;
33 | }
34 | }
35 |
36 | - (void)bc_viewWillDisappear:(BOOL)animated {
37 | [self bc_viewWillDisappear:animated];
38 |
39 | // Stop being the navigation controller's delegate
40 | if (self.navigationController.delegate == self) {
41 | self.navigationController.delegate = nil;
42 | }
43 | }
44 |
45 |
46 | #pragma mark - Class Methods
47 | + (void)load {
48 | [super load];
49 |
50 | static dispatch_once_t onceToken;
51 | dispatch_once(&onceToken, ^{
52 |
53 | Method original, swizzled;
54 |
55 | //viewDidAppear:
56 | {
57 | original = class_getInstanceMethod(self, @selector(viewDidAppear:));
58 | swizzled = class_getInstanceMethod(self, @selector(bc_viewDidAppear:));
59 | method_exchangeImplementations(original, swizzled);
60 | }
61 |
62 | //viewWillDisappear:
63 | {
64 | original = class_getInstanceMethod(self, @selector(viewWillDisappear:));
65 | swizzled = class_getInstanceMethod(self, @selector(bc_viewWillDisappear:));
66 | method_exchangeImplementations(original, swizzled);
67 | }
68 |
69 | });
70 | }
71 |
72 |
73 | #pragma mark - Properties
74 |
75 | - (UIPercentDrivenInteractiveTransition *)interactivePopTransition {
76 | return objc_getAssociatedObject(self, &kInteractivePopTransition);
77 | }
78 |
79 | - (void)setInteractivePopTransition:(UIPercentDrivenInteractiveTransition *)value {
80 | objc_setAssociatedObject(self, &kInteractivePopTransition, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
81 | }
82 |
83 | - (BCMagicTransition *)popTransit {
84 | return objc_getAssociatedObject(self, &kPopTransit);
85 | }
86 |
87 | - (void)setPopTransit:(BCMagicTransition *)value {
88 | objc_setAssociatedObject(self, &kPopTransit, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
89 | }
90 |
91 | - (BCMagicTransition *)pushTransit {
92 | return objc_getAssociatedObject(self, &kPushTransit);
93 | }
94 |
95 | - (void)setPushTransit:(BCMagicTransition *)value {
96 | objc_setAssociatedObject(self, &kPushTransit, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
97 | }
98 |
99 |
100 | #pragma mark - Instance methods
101 |
102 | - (void)pushViewController:(UIViewController *)viewController
103 | fromView:(UIView *)fromView
104 | toView:(UIView *)toView
105 | duration:(NSTimeInterval)duration
106 | {
107 | [self pushViewController:viewController fromViews:@[fromView] toViews:@[toView] duration:duration];
108 | }
109 |
110 | - (void)pushViewController:(UIViewController *)viewController
111 | fromViews:(NSArray *)fromViews
112 | toViews:(NSArray *)toViews
113 | duration:(NSTimeInterval)duration
114 | {
115 | BCMagicTransition *magicPush = [BCMagicTransition new];
116 | magicPush.isMagic = YES;
117 | magicPush.isPush = YES;
118 | magicPush.duration = duration;
119 | magicPush.fromViews = fromViews;
120 | magicPush.toViews = toViews;
121 | self.pushTransit = magicPush;
122 | self.navigationController.delegate = self;
123 |
124 | BCMagicTransition *magicPop = [BCMagicTransition new];
125 | magicPop.isMagic = YES;
126 | magicPop.isPush = NO;
127 | magicPop.duration = duration;
128 | magicPop.fromViews = toViews;
129 | magicPop.toViews = fromViews;
130 | viewController.popTransit = magicPop;
131 |
132 | // add pop gesture to viewController
133 | UIScreenEdgePanGestureRecognizer *edgePanGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:viewController action:@selector(edgePanGesture:)];
134 | edgePanGestureRecognizer.edges = UIRectEdgeLeft;
135 | [viewController.view addGestureRecognizer:edgePanGestureRecognizer];
136 |
137 | [self.navigationController pushViewController:viewController animated:YES];
138 | }
139 |
140 | #pragma mark -
141 |
142 | - (void)navigationController:(UINavigationController *)navigationController
143 | didShowViewController:(UIViewController *)viewController
144 | animated:(BOOL)animated
145 | {
146 | if ([viewController conformsToProtocol:NSProtocolFromString(@"BCMagicTransitionProtocol")]) {
147 | [(UIViewController *)viewController setPushTransit:nil];
148 | }
149 | }
150 |
151 | - (id)navigationController:(UINavigationController *)navigationController
152 | animationControllerForOperation:(UINavigationControllerOperation)operation
153 | fromViewController:(UIViewController *)fromVC
154 | toViewController:(UIViewController *)toVC
155 | {
156 | switch (operation) {
157 | case UINavigationControllerOperationPush: {
158 | if ([fromVC conformsToProtocol:NSProtocolFromString(@"BCMagicTransitionProtocol")] && fromVC.pushTransit) {
159 | return fromVC.pushTransit;
160 | } else {
161 | BCMagicTransition *normalPush = [BCMagicTransition new];
162 | normalPush.isMagic = NO;
163 | normalPush.isPush = YES;
164 | normalPush.duration = DEFAULT_TRANSITON_DURATION;
165 | normalPush.delay = DEFAULT_TRANSITON_DELAY;
166 | normalPush.damping = DEFAULT_TRANSITON_DAMPING;
167 | normalPush.velocity = DEFAULT_TRANSITON_VELOCITY;
168 | return normalPush;
169 | }
170 | break;
171 | }
172 | case UINavigationControllerOperationPop: {
173 | if ([fromVC conformsToProtocol:NSProtocolFromString(@"BCMagicTransitionProtocol")] && fromVC.popTransit) {
174 | return fromVC.popTransit;
175 | } else {
176 | BCMagicTransition *normalPop = [BCMagicTransition new];
177 | normalPop.isMagic = NO;
178 | normalPop.isPush = NO;
179 | normalPop.duration = DEFAULT_TRANSITON_DURATION;
180 | normalPop.delay = DEFAULT_TRANSITON_DELAY;
181 | normalPop.damping = DEFAULT_TRANSITON_DAMPING;
182 | normalPop.velocity = DEFAULT_TRANSITON_VELOCITY;
183 | return normalPop;
184 | }
185 | break;
186 | }
187 | default: {
188 | return nil;
189 | }
190 | }
191 | }
192 |
193 | - (id)navigationController:(UINavigationController *)navigationController
194 | interactionControllerForAnimationController:(id)animationController
195 | {
196 | BCMagicTransition *magicTransition = animationController;
197 | if ([self conformsToProtocol:NSProtocolFromString(@"BCMagicTransitionProtocol")] && !magicTransition.isPush) {
198 | return self.interactivePopTransition;
199 | }
200 |
201 | return nil;
202 | }
203 |
204 |
205 | #pragma mark - pop gesture
206 |
207 | - (void)edgePanGesture:(UIScreenEdgePanGestureRecognizer *)recognizer {
208 | CGFloat progress = [recognizer translationInView:self.view].x / (self.view.bounds.size.width * 1.0);
209 | progress = MIN(1.0, MAX(0.0, progress));
210 |
211 | switch (recognizer.state) {
212 | case UIGestureRecognizerStateBegan: {
213 | self.interactivePopTransition = [UIPercentDrivenInteractiveTransition new];
214 | [self.navigationController popViewControllerAnimated:YES];
215 | break;
216 | }
217 | case UIGestureRecognizerStateChanged: {
218 | [self.interactivePopTransition updateInteractiveTransition:progress];
219 | break;
220 | }
221 | case UIGestureRecognizerStateEnded:
222 | case UIGestureRecognizerStateCancelled: {
223 | if (progress > 0.3) {
224 | [self.interactivePopTransition finishInteractiveTransition];
225 | } else {
226 | [self.interactivePopTransition cancelInteractiveTransition];
227 | }
228 | self.interactivePopTransition = nil;
229 | break;
230 | }
231 | default: {
232 | break;
233 | }
234 | }
235 | }
236 |
237 | @end
238 |
--------------------------------------------------------------------------------
/Demo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | E138B7E91AD50C4000843CCA /* BCMagicTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = E138B7E61AD50C4000843CCA /* BCMagicTransition.m */; };
11 | E138B7EE1AD5140300843CCA /* ThirdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E138B7EC1AD5140300843CCA /* ThirdViewController.m */; };
12 | E138B7EF1AD5140300843CCA /* ThirdViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E138B7ED1AD5140300843CCA /* ThirdViewController.xib */; };
13 | E17EDCE31A03C5890097DD5C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E17EDCE21A03C5890097DD5C /* main.m */; };
14 | E17EDCE61A03C5890097DD5C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E17EDCE51A03C5890097DD5C /* AppDelegate.m */; };
15 | E17EDCF11A03C5890097DD5C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E17EDCF01A03C5890097DD5C /* Images.xcassets */; };
16 | E17EDCF41A03C5890097DD5C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E17EDCF21A03C5890097DD5C /* LaunchScreen.xib */; };
17 | E17EDD131A03C6110097DD5C /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E17EDD111A03C6110097DD5C /* FirstViewController.m */; };
18 | E17EDD141A03C6110097DD5C /* FirstViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E17EDD121A03C6110097DD5C /* FirstViewController.xib */; };
19 | E17EDD181A03C6220097DD5C /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E17EDD161A03C6220097DD5C /* SecondViewController.m */; };
20 | E17EDD191A03C6220097DD5C /* SecondViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E17EDD171A03C6220097DD5C /* SecondViewController.xib */; };
21 | E17EDD1B1A03C6C80097DD5C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E17EDD1A1A03C6C80097DD5C /* UIKit.framework */; };
22 | F05986AD1B203D36004C2C06 /* UIViewController+BCMagicTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = F05986AC1B203D36004C2C06 /* UIViewController+BCMagicTransition.m */; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXFileReference section */
26 | E138B7E51AD50C4000843CCA /* BCMagicTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCMagicTransition.h; path = BCMagicTransition/BCMagicTransition.h; sourceTree = ""; };
27 | E138B7E61AD50C4000843CCA /* BCMagicTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCMagicTransition.m; path = BCMagicTransition/BCMagicTransition.m; sourceTree = ""; };
28 | E138B7EB1AD5140300843CCA /* ThirdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThirdViewController.h; sourceTree = ""; };
29 | E138B7EC1AD5140300843CCA /* ThirdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThirdViewController.m; sourceTree = ""; };
30 | E138B7ED1AD5140300843CCA /* ThirdViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ThirdViewController.xib; sourceTree = ""; };
31 | E17EDCDD1A03C5890097DD5C /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
32 | E17EDCE11A03C5890097DD5C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
33 | E17EDCE21A03C5890097DD5C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
34 | E17EDCE41A03C5890097DD5C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
35 | E17EDCE51A03C5890097DD5C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
36 | E17EDCF01A03C5890097DD5C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
37 | E17EDCF31A03C5890097DD5C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
38 | E17EDD101A03C6110097DD5C /* FirstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; };
39 | E17EDD111A03C6110097DD5C /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; };
40 | E17EDD121A03C6110097DD5C /* FirstViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FirstViewController.xib; sourceTree = ""; };
41 | E17EDD151A03C6220097DD5C /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; };
42 | E17EDD161A03C6220097DD5C /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; };
43 | E17EDD171A03C6220097DD5C /* SecondViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SecondViewController.xib; sourceTree = ""; };
44 | E17EDD1A1A03C6C80097DD5C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
45 | F05986AB1B203D36004C2C06 /* UIViewController+BCMagicTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+BCMagicTransition.h"; path = "BCMagicTransition/UIViewController+BCMagicTransition.h"; sourceTree = ""; };
46 | F05986AC1B203D36004C2C06 /* UIViewController+BCMagicTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+BCMagicTransition.m"; path = "BCMagicTransition/UIViewController+BCMagicTransition.m"; sourceTree = ""; };
47 | /* End PBXFileReference section */
48 |
49 | /* Begin PBXFrameworksBuildPhase section */
50 | E17EDCDA1A03C5890097DD5C /* Frameworks */ = {
51 | isa = PBXFrameworksBuildPhase;
52 | buildActionMask = 2147483647;
53 | files = (
54 | E17EDD1B1A03C6C80097DD5C /* UIKit.framework in Frameworks */,
55 | );
56 | runOnlyForDeploymentPostprocessing = 0;
57 | };
58 | /* End PBXFrameworksBuildPhase section */
59 |
60 | /* Begin PBXGroup section */
61 | E138B7E41AD50BE600843CCA /* BSMagicTransition */ = {
62 | isa = PBXGroup;
63 | children = (
64 | E138B7E51AD50C4000843CCA /* BCMagicTransition.h */,
65 | E138B7E61AD50C4000843CCA /* BCMagicTransition.m */,
66 | F05986AB1B203D36004C2C06 /* UIViewController+BCMagicTransition.h */,
67 | F05986AC1B203D36004C2C06 /* UIViewController+BCMagicTransition.m */,
68 | );
69 | name = BSMagicTransition;
70 | sourceTree = "";
71 | };
72 | E138B7F01AD5140800843CCA /* FirstViewController */ = {
73 | isa = PBXGroup;
74 | children = (
75 | E17EDD101A03C6110097DD5C /* FirstViewController.h */,
76 | E17EDD111A03C6110097DD5C /* FirstViewController.m */,
77 | E17EDD121A03C6110097DD5C /* FirstViewController.xib */,
78 | );
79 | name = FirstViewController;
80 | sourceTree = "";
81 | };
82 | E138B7F11AD5141300843CCA /* SecondViewController */ = {
83 | isa = PBXGroup;
84 | children = (
85 | E17EDD151A03C6220097DD5C /* SecondViewController.h */,
86 | E17EDD161A03C6220097DD5C /* SecondViewController.m */,
87 | E17EDD171A03C6220097DD5C /* SecondViewController.xib */,
88 | );
89 | name = SecondViewController;
90 | sourceTree = "";
91 | };
92 | E138B7F21AD5141B00843CCA /* ThirdViewController */ = {
93 | isa = PBXGroup;
94 | children = (
95 | E138B7EB1AD5140300843CCA /* ThirdViewController.h */,
96 | E138B7EC1AD5140300843CCA /* ThirdViewController.m */,
97 | E138B7ED1AD5140300843CCA /* ThirdViewController.xib */,
98 | );
99 | name = ThirdViewController;
100 | sourceTree = "";
101 | };
102 | E17EDCD41A03C5890097DD5C = {
103 | isa = PBXGroup;
104 | children = (
105 | E138B7E41AD50BE600843CCA /* BSMagicTransition */,
106 | E17EDCDF1A03C5890097DD5C /* Demo */,
107 | E17EDCDE1A03C5890097DD5C /* Products */,
108 | );
109 | sourceTree = "";
110 | };
111 | E17EDCDE1A03C5890097DD5C /* Products */ = {
112 | isa = PBXGroup;
113 | children = (
114 | E17EDCDD1A03C5890097DD5C /* Demo.app */,
115 | );
116 | name = Products;
117 | sourceTree = "";
118 | };
119 | E17EDCDF1A03C5890097DD5C /* Demo */ = {
120 | isa = PBXGroup;
121 | children = (
122 | E17EDCE41A03C5890097DD5C /* AppDelegate.h */,
123 | E17EDCE51A03C5890097DD5C /* AppDelegate.m */,
124 | E138B7F01AD5140800843CCA /* FirstViewController */,
125 | E138B7F11AD5141300843CCA /* SecondViewController */,
126 | E138B7F21AD5141B00843CCA /* ThirdViewController */,
127 | E17EDCF01A03C5890097DD5C /* Images.xcassets */,
128 | E17EDCF21A03C5890097DD5C /* LaunchScreen.xib */,
129 | E17EDCE01A03C5890097DD5C /* Supporting Files */,
130 | );
131 | name = Demo;
132 | path = MagicTransition;
133 | sourceTree = "";
134 | };
135 | E17EDCE01A03C5890097DD5C /* Supporting Files */ = {
136 | isa = PBXGroup;
137 | children = (
138 | E17EDD1A1A03C6C80097DD5C /* UIKit.framework */,
139 | E17EDCE11A03C5890097DD5C /* Info.plist */,
140 | E17EDCE21A03C5890097DD5C /* main.m */,
141 | );
142 | name = "Supporting Files";
143 | sourceTree = "";
144 | };
145 | /* End PBXGroup section */
146 |
147 | /* Begin PBXNativeTarget section */
148 | E17EDCDC1A03C5890097DD5C /* Demo */ = {
149 | isa = PBXNativeTarget;
150 | buildConfigurationList = E17EDD031A03C5890097DD5C /* Build configuration list for PBXNativeTarget "Demo" */;
151 | buildPhases = (
152 | E17EDCD91A03C5890097DD5C /* Sources */,
153 | E17EDCDA1A03C5890097DD5C /* Frameworks */,
154 | E17EDCDB1A03C5890097DD5C /* Resources */,
155 | );
156 | buildRules = (
157 | );
158 | dependencies = (
159 | );
160 | name = Demo;
161 | productName = MagicTransition;
162 | productReference = E17EDCDD1A03C5890097DD5C /* Demo.app */;
163 | productType = "com.apple.product-type.application";
164 | };
165 | /* End PBXNativeTarget section */
166 |
167 | /* Begin PBXProject section */
168 | E17EDCD51A03C5890097DD5C /* Project object */ = {
169 | isa = PBXProject;
170 | attributes = {
171 | LastUpgradeCheck = 0610;
172 | ORGANIZATIONNAME = Boyce;
173 | TargetAttributes = {
174 | E17EDCDC1A03C5890097DD5C = {
175 | CreatedOnToolsVersion = 6.1;
176 | DevelopmentTeam = UXQ4US7LL6;
177 | };
178 | };
179 | };
180 | buildConfigurationList = E17EDCD81A03C5890097DD5C /* Build configuration list for PBXProject "Demo" */;
181 | compatibilityVersion = "Xcode 3.2";
182 | developmentRegion = English;
183 | hasScannedForEncodings = 0;
184 | knownRegions = (
185 | en,
186 | Base,
187 | );
188 | mainGroup = E17EDCD41A03C5890097DD5C;
189 | productRefGroup = E17EDCDE1A03C5890097DD5C /* Products */;
190 | projectDirPath = "";
191 | projectRoot = "";
192 | targets = (
193 | E17EDCDC1A03C5890097DD5C /* Demo */,
194 | );
195 | };
196 | /* End PBXProject section */
197 |
198 | /* Begin PBXResourcesBuildPhase section */
199 | E17EDCDB1A03C5890097DD5C /* Resources */ = {
200 | isa = PBXResourcesBuildPhase;
201 | buildActionMask = 2147483647;
202 | files = (
203 | E17EDD191A03C6220097DD5C /* SecondViewController.xib in Resources */,
204 | E17EDCF41A03C5890097DD5C /* LaunchScreen.xib in Resources */,
205 | E17EDD141A03C6110097DD5C /* FirstViewController.xib in Resources */,
206 | E138B7EF1AD5140300843CCA /* ThirdViewController.xib in Resources */,
207 | E17EDCF11A03C5890097DD5C /* Images.xcassets in Resources */,
208 | );
209 | runOnlyForDeploymentPostprocessing = 0;
210 | };
211 | /* End PBXResourcesBuildPhase section */
212 |
213 | /* Begin PBXSourcesBuildPhase section */
214 | E17EDCD91A03C5890097DD5C /* Sources */ = {
215 | isa = PBXSourcesBuildPhase;
216 | buildActionMask = 2147483647;
217 | files = (
218 | F05986AD1B203D36004C2C06 /* UIViewController+BCMagicTransition.m in Sources */,
219 | E17EDD131A03C6110097DD5C /* FirstViewController.m in Sources */,
220 | E17EDD181A03C6220097DD5C /* SecondViewController.m in Sources */,
221 | E17EDCE61A03C5890097DD5C /* AppDelegate.m in Sources */,
222 | E17EDCE31A03C5890097DD5C /* main.m in Sources */,
223 | E138B7E91AD50C4000843CCA /* BCMagicTransition.m in Sources */,
224 | E138B7EE1AD5140300843CCA /* ThirdViewController.m in Sources */,
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXSourcesBuildPhase section */
229 |
230 | /* Begin PBXVariantGroup section */
231 | E17EDCF21A03C5890097DD5C /* LaunchScreen.xib */ = {
232 | isa = PBXVariantGroup;
233 | children = (
234 | E17EDCF31A03C5890097DD5C /* Base */,
235 | );
236 | name = LaunchScreen.xib;
237 | sourceTree = "";
238 | };
239 | /* End PBXVariantGroup section */
240 |
241 | /* Begin XCBuildConfiguration section */
242 | E17EDD011A03C5890097DD5C /* Debug */ = {
243 | isa = XCBuildConfiguration;
244 | buildSettings = {
245 | ALWAYS_SEARCH_USER_PATHS = NO;
246 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
247 | CLANG_CXX_LIBRARY = "libc++";
248 | CLANG_ENABLE_MODULES = YES;
249 | CLANG_ENABLE_OBJC_ARC = YES;
250 | CLANG_WARN_BOOL_CONVERSION = YES;
251 | CLANG_WARN_CONSTANT_CONVERSION = YES;
252 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
253 | CLANG_WARN_EMPTY_BODY = YES;
254 | CLANG_WARN_ENUM_CONVERSION = YES;
255 | CLANG_WARN_INT_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_UNREACHABLE_CODE = YES;
258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
259 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
260 | COPY_PHASE_STRIP = NO;
261 | ENABLE_STRICT_OBJC_MSGSEND = YES;
262 | GCC_C_LANGUAGE_STANDARD = gnu99;
263 | GCC_DYNAMIC_NO_PIC = NO;
264 | GCC_OPTIMIZATION_LEVEL = 0;
265 | GCC_PREPROCESSOR_DEFINITIONS = (
266 | "DEBUG=1",
267 | "$(inherited)",
268 | );
269 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
270 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
271 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
272 | GCC_WARN_UNDECLARED_SELECTOR = YES;
273 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
274 | GCC_WARN_UNUSED_FUNCTION = YES;
275 | GCC_WARN_UNUSED_VARIABLE = YES;
276 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
277 | MTL_ENABLE_DEBUG_INFO = YES;
278 | ONLY_ACTIVE_ARCH = YES;
279 | SDKROOT = iphoneos;
280 | };
281 | name = Debug;
282 | };
283 | E17EDD021A03C5890097DD5C /* Release */ = {
284 | isa = XCBuildConfiguration;
285 | buildSettings = {
286 | ALWAYS_SEARCH_USER_PATHS = NO;
287 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
288 | CLANG_CXX_LIBRARY = "libc++";
289 | CLANG_ENABLE_MODULES = YES;
290 | CLANG_ENABLE_OBJC_ARC = YES;
291 | CLANG_WARN_BOOL_CONVERSION = YES;
292 | CLANG_WARN_CONSTANT_CONVERSION = YES;
293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
294 | CLANG_WARN_EMPTY_BODY = YES;
295 | CLANG_WARN_ENUM_CONVERSION = YES;
296 | CLANG_WARN_INT_CONVERSION = YES;
297 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
298 | CLANG_WARN_UNREACHABLE_CODE = YES;
299 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
300 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
301 | COPY_PHASE_STRIP = YES;
302 | ENABLE_NS_ASSERTIONS = NO;
303 | ENABLE_STRICT_OBJC_MSGSEND = YES;
304 | GCC_C_LANGUAGE_STANDARD = gnu99;
305 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
306 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
307 | GCC_WARN_UNDECLARED_SELECTOR = YES;
308 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
309 | GCC_WARN_UNUSED_FUNCTION = YES;
310 | GCC_WARN_UNUSED_VARIABLE = YES;
311 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
312 | MTL_ENABLE_DEBUG_INFO = NO;
313 | SDKROOT = iphoneos;
314 | VALIDATE_PRODUCT = YES;
315 | };
316 | name = Release;
317 | };
318 | E17EDD041A03C5890097DD5C /* Debug */ = {
319 | isa = XCBuildConfiguration;
320 | buildSettings = {
321 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
322 | CODE_SIGN_IDENTITY = "iPhone Developer";
323 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
324 | INFOPLIST_FILE = MagicTransition/Info.plist;
325 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
326 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
327 | PRODUCT_NAME = Demo;
328 | PROVISIONING_PROFILE = "";
329 | };
330 | name = Debug;
331 | };
332 | E17EDD051A03C5890097DD5C /* Release */ = {
333 | isa = XCBuildConfiguration;
334 | buildSettings = {
335 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
336 | CODE_SIGN_IDENTITY = "iPhone Developer";
337 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
338 | INFOPLIST_FILE = MagicTransition/Info.plist;
339 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
340 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
341 | PRODUCT_NAME = Demo;
342 | PROVISIONING_PROFILE = "";
343 | };
344 | name = Release;
345 | };
346 | /* End XCBuildConfiguration section */
347 |
348 | /* Begin XCConfigurationList section */
349 | E17EDCD81A03C5890097DD5C /* Build configuration list for PBXProject "Demo" */ = {
350 | isa = XCConfigurationList;
351 | buildConfigurations = (
352 | E17EDD011A03C5890097DD5C /* Debug */,
353 | E17EDD021A03C5890097DD5C /* Release */,
354 | );
355 | defaultConfigurationIsVisible = 0;
356 | defaultConfigurationName = Release;
357 | };
358 | E17EDD031A03C5890097DD5C /* Build configuration list for PBXNativeTarget "Demo" */ = {
359 | isa = XCConfigurationList;
360 | buildConfigurations = (
361 | E17EDD041A03C5890097DD5C /* Debug */,
362 | E17EDD051A03C5890097DD5C /* Release */,
363 | );
364 | defaultConfigurationIsVisible = 0;
365 | defaultConfigurationName = Release;
366 | };
367 | /* End XCConfigurationList section */
368 | };
369 | rootObject = E17EDCD51A03C5890097DD5C /* Project object */;
370 | }
371 |
--------------------------------------------------------------------------------