├── .gitignore ├── RASlideInViewController-Demo ├── RASlideInViewController-Demo.xcodeproj │ ├── .LSOverride │ ├── xcuserdata │ │ └── Ryo.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── RASlideInViewController-Demo.xcscheme │ └── project.pbxproj ├── RASlideInViewController-Demo │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── RASlideInViewController │ │ ├── RAViewController.h │ │ ├── RANewSlideInViewController.h │ │ ├── RASlideInViewController.h │ │ ├── RANewSlideInViewController.m │ │ ├── RAViewController.m │ │ └── RASlideInViewController.m │ ├── RAAppDelegate.h │ ├── main.m │ ├── RASlideInViewController-Demo-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── RASlideInViewController-Demo-Info.plist │ ├── RAAppDelegate.m │ └── Main.storyboard └── RASlideInViewController-DemoTests │ ├── en.lproj │ └── InfoPlist.strings │ ├── RASlideInViewController-DemoTests-Info.plist │ └── RASlideInViewController_DemoTests.m ├── Assets ├── animation.gif ├── screenshot1.png ├── screenshot2.png └── screenshot3.png ├── RASlideInViewController.podspec ├── RASlideInViewController ├── RASlideInViewController.h └── RASlideInViewController.m ├── LICENSE.txt └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | #ignore 2 | .DS_Store 3 | 4 | #pods 5 | Podfile 6 | Podfile.lock 7 | Pods 8 | *.xcworkspace -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo.xcodeproj/.LSOverride: -------------------------------------------------------------------------------- 1 | /Applications/Xcode.app -------------------------------------------------------------------------------- /Assets/animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/RASlideInViewController/HEAD/Assets/animation.gif -------------------------------------------------------------------------------- /Assets/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/RASlideInViewController/HEAD/Assets/screenshot1.png -------------------------------------------------------------------------------- /Assets/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/RASlideInViewController/HEAD/Assets/screenshot2.png -------------------------------------------------------------------------------- /Assets/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ra1028/RASlideInViewController/HEAD/Assets/screenshot3.png -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-DemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo.xcodeproj/xcuserdata/Ryo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController/RAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RAViewController.h 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RAViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RAAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // RAAppDelegate.h 3 | // RASlideInViewController-Demo 4 | // 5 | // Created by Ryo Aoyama on 5/1/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RAAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController/RANewSlideInViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RANewCardViewController.h 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import "RASlideInViewController.h" 10 | 11 | @interface RANewSlideInViewController : RASlideInViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UIButton *addNewViewButton; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RASlideInViewController-Demo 4 | // 5 | // Created by Ryo Aoyama on 5/1/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "RAAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([RAAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController-Demo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 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 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /RASlideInViewController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "RASlideInViewController" 3 | s.version = "0.0.4" 4 | s.summary = "RASlideInViewController has an transition effect expressing the depth, and you can dismiss it by draging" 5 | s.license = { :type => 'MIT', :file => 'LICENSE.txt' } 6 | s.homepage = "https://github.com/ra1028/RASlideInViewController" 7 | s.author = { "ra1028" => "r.fe51028.r@gmail.com" } 8 | s.platform = :ios, '7.0' 9 | s.source = { :git => "https://github.com/ra1028/RASlideInViewController.git", :tag => "0.0.4" } 10 | s.requires_arc = true 11 | s.source_files = 'RASlideInViewController/*.{h,m}' 12 | end -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo.xcodeproj/xcuserdata/Ryo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RASlideInViewController-Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 2A1C57EB1911859B007013D2 16 | 17 | primary 18 | 19 | 20 | 2A1C580C1911859B007013D2 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-DemoTests/RASlideInViewController-DemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.ryo.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-DemoTests/RASlideInViewController_DemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RASlideInViewController_DemoTests.m 3 | // RASlideInViewController-DemoTests 4 | // 5 | // Created by Ryo Aoyama on 5/1/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RASlideInViewController_DemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation RASlideInViewController_DemoTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /RASlideInViewController/RASlideInViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACardViewController.h 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger, RASlideViewSlideInDirection){ 12 | RASlideInDirectionBottomToTop, 13 | RASlideInDirectionRightToLeft, 14 | RASlideInDirectionTopToBottom, 15 | RASlideInDirectionLeftToRight 16 | }; 17 | 18 | @interface RASlideInViewController : UIViewController 19 | 20 | @property (nonatomic, assign) RASlideViewSlideInDirection slideInDirection; //default RASlideInDirectionBottomToTop; 21 | @property (nonatomic, assign) BOOL shiftBackDropView; //default NO 22 | @property (nonatomic, assign) CGFloat animationDuration; //default .3f 23 | @property (nonatomic, assign) CGFloat backdropViewScaleReductionRatio; //default .9f 24 | @property (nonatomic, assign) CGFloat shiftBackDropViewValue; //default 100.f 25 | @property (nonatomic, assign) CGFloat backDropViewAlpha; //default 0 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController/RASlideInViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACardViewController.h 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger, RASlideViewSlideInDirection){ 12 | RASlideInDirectionBottomToTop, 13 | RASlideInDirectionRightToLeft, 14 | RASlideInDirectionTopToBottom, 15 | RASlideInDirectionLeftToRight 16 | }; 17 | 18 | @interface RASlideInViewController : UIViewController 19 | 20 | @property (nonatomic, assign) RASlideViewSlideInDirection slideInDirection; //default RASlideInDirectionBottomToTop; 21 | @property (nonatomic, assign) BOOL shiftBackDropView; //default NO 22 | @property (nonatomic, assign) CGFloat animationDuration; //default .3f 23 | @property (nonatomic, assign) CGFloat backdropViewScaleReductionRatio; //default .9f 24 | @property (nonatomic, assign) CGFloat shiftBackDropViewValue; //default 100.f 25 | @property (nonatomic, assign) CGFloat backDropViewAlpha; //default 0 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 ra1028 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController-Demo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.ryo.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController/RANewSlideInViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RANewCardViewController.m 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import "RANewSlideInViewController.h" 10 | 11 | @interface RANewSlideInViewController () 12 | 13 | 14 | @end 15 | 16 | @implementation RANewSlideInViewController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | 22 | //Random background color 23 | [self randomBackgroundColor]; 24 | } 25 | 26 | - (void)randomBackgroundColor 27 | { 28 | CGFloat rValue = arc4random() % 256; 29 | CGFloat gValue = arc4random() % 256; 30 | CGFloat bValue = arc4random() % 256; 31 | 32 | self.view.backgroundColor = [UIColor colorWithRed:rValue/255.0 green:gValue/255.0 blue:bValue/255.0 alpha:1.0]; 33 | [self.addNewViewButton setTitleColor:[UIColor colorWithRed:rValue/255.0 green:gValue/255.0 blue:bValue/255.0 alpha:1.0] forState:UIControlStateNormal]; 34 | } 35 | 36 | - (IBAction)addNewView:(UIButton *)sender 37 | { 38 | UIStoryboard *storyboard = self.storyboard; 39 | RANewSlideInViewController *slideInViewController = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([RANewSlideInViewController class])]; 40 | 41 | slideInViewController.slideInDirection = RASlideInDirectionRightToLeft; 42 | slideInViewController.shiftBackDropView = YES; 43 | slideInViewController.backDropViewAlpha = .4f; 44 | 45 | self.modalPresentationStyle = UIModalPresentationCurrentContext; //*** 46 | 47 | [self presentViewController:slideInViewController animated:NO completion:nil]; 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController/RAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RAViewController.m 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import "RAViewController.h" 10 | #import "RANewSlideInViewController.h" 11 | 12 | @interface RAViewController () 13 | 14 | @property (nonatomic, strong) UIWindow *subWindow; 15 | 16 | @end 17 | 18 | @implementation RAViewController 19 | 20 | - (void)viewDidLoad 21 | { 22 | [super viewDidLoad]; 23 | } 24 | 25 | - (IBAction)addNewView:(UIButton *)sender 26 | { 27 | // UIStoryboard *storyboard = self.storyboard; 28 | // RANewSlideInViewController *slideViewController = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([RANewSlideInViewController class])]; 29 | RANewSlideInViewController *slideViewController = [[RANewSlideInViewController alloc] init]; 30 | 31 | self.modalPresentationStyle = UIModalPresentationCurrentContext; //*** 32 | 33 | [self presentViewController:slideViewController animated:NO completion:nil]; 34 | } 35 | 36 | - (IBAction)addNewWindow:(UIButton *)sender 37 | { 38 | UIStoryboard *storyboard = self.storyboard; 39 | RANewSlideInViewController *slideViewController = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([RANewSlideInViewController class])]; 40 | 41 | slideViewController.slideInDirection = RASlideInDirectionLeftToRight; 42 | 43 | _subWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 44 | _subWindow.windowLevel = UIWindowLevelStatusBar; 45 | _subWindow.rootViewController = slideViewController; 46 | [_subWindow makeKeyAndVisible]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RAAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // RAAppDelegate.m 3 | // RASlideInViewController-Demo 4 | // 5 | // Created by Ryo Aoyama on 5/1/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import "RAAppDelegate.h" 10 | 11 | @implementation RAAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | [application setStatusBarStyle:UIStatusBarStyleLightContent]; 16 | 17 | return YES; 18 | } 19 | 20 | - (void)applicationWillResignActive:(UIApplication *)application 21 | { 22 | // 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. 23 | // 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. 24 | } 25 | 26 | - (void)applicationDidEnterBackground:(UIApplication *)application 27 | { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | - (void)applicationWillEnterForeground:(UIApplication *)application 33 | { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application 38 | { 39 | // 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. 40 | } 41 | 42 | - (void)applicationWillTerminate:(UIApplication *)application 43 | { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RASlideInViewController 2 | ======================= 3 | 4 | #### RASlideInViewController has an transition effect expressing the depth, and you can dismiss it by draging. 5 | 6 | 7 | ### Screen shots 8 | ![screen shot1](https://github.com/ra1028/RASlideInViewController/raw/master/Assets/screenshot1.png) 9 | ![screen shot2](https://github.com/ra1028/RASlideInViewController/raw/master/Assets/screenshot2.png) 10 | ![screen shot3](https://github.com/ra1028/RASlideInViewController/raw/master/Assets/screenshot3.png) 11 | 12 | 13 | ### Example animation 14 | ![animated gif](https://github.com/ra1028/RASlideInViewController/raw/master/Assets/animation.gif) 15 | 16 | ### Usage 17 | 18 | Please add the library into your project, and create subclass of this class. 19 | 20 | #### Example 21 | ```Objective-C 22 | UIStoryboard *storyboard = self.storyboard; 23 | RANewSlideInViewController *slideViewController = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([RANewSlideInViewController class])]; 24 | 25 | self.modalPresentationStyle = UIModalPresentationCurrentContext; //*** 26 | 27 | [self presentViewController:slideViewController animated:NO completion:nil]; 28 | ``` 29 | 30 | ```Objective-C 31 | UIStoryboard *storyboard = self.storyboard; 32 | RANewSlideInViewController *slideViewController = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([RANewSlideInViewController class])]; 33 | slideViewController.slideInDirection = RASlideInDirectionLeftToRight; 34 | 35 | _subWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 36 | _subWindow.windowLevel = UIWindowLevelStatusBar; 37 | _subWindow.rootViewController = slideViewController; 38 | [_subWindow makeKeyAndVisible]; 39 | ``` 40 | 41 | #### Option 42 | ```Objective-C 43 | typedef NS_ENUM(NSInteger, RASlideViewSlideInDirection){ 44 | RASlideInDirectionBottomToTop, 45 | RASlideInDirectionRightToLeft, 46 | RASlideInDirectionTopToBottom, 47 | RASlideInDirectionLeftToRight 48 | }; 49 | 50 | @interface RASlideInViewController : UIViewController 51 | 52 | @property (nonatomic, assign) RASlideViewSlideInDirection slideInDirection; //default RASlideInDirectionBottomToTop; 53 | @property (nonatomic, assign) BOOL shiftBackDropView; //default NO 54 | @property (nonatomic, assign) CGFloat animationDuration; //default .3f 55 | @property (nonatomic, assign) CGFloat backdropViewScaleReductionRatio; //default .9f 56 | @property (nonatomic, assign) CGFloat shiftBackDropViewValue; //default 100.f 57 | @property (nonatomic, assign) CGFloat backDropViewAlpha; //default 0 58 | 59 | @end 60 | ``` 61 | 62 | ### License 63 | RASlideInViewController is released under the MIT License, see LICENSE.txt. 64 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo.xcodeproj/xcuserdata/Ryo.xcuserdatad/xcschemes/RASlideInViewController-Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 32 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /RASlideInViewController/RASlideInViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACardViewController.m 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import "RASlideInViewController.h" 10 | 11 | @interface RASlideInViewController () 12 | 13 | @property (nonatomic, assign) BOOL appered; 14 | 15 | @end 16 | 17 | @implementation RASlideInViewController 18 | { 19 | UIView *_backDropView; 20 | } 21 | 22 | - (id)initWithCoder:(NSCoder *)aDecoder 23 | { 24 | self = [super initWithCoder:aDecoder]; 25 | if (self) { 26 | //do any setup 27 | [self initialSetup]; 28 | } 29 | return self; 30 | } 31 | 32 | - (id)init 33 | { 34 | self = [super init]; 35 | if (self) { 36 | //do any setup 37 | [self initialSetup]; 38 | } 39 | return self; 40 | } 41 | 42 | - (void)viewDidLoad 43 | { 44 | [super viewDidLoad]; 45 | 46 | //configre 47 | [self configure]; 48 | } 49 | 50 | - (void)viewDidAppear:(BOOL)animated 51 | { 52 | //back drop view 53 | _backDropView = [self backDropView]; 54 | if (!_appered) 55 | { 56 | //alpha 57 | self.view.alpha = 1.f; 58 | 59 | //backDropView superview alpha 0 60 | self.presentingViewController.presentingViewController.view.alpha = 0; 61 | 62 | //animation 63 | [UIView animateWithDuration:_animationDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 64 | CGSize viewSize = self.view.bounds.size; 65 | self.view.frame = [self appearedAnimationStandbyPosition]; 66 | self.view.frame = CGRectMake(0, 0, viewSize.width, viewSize.height); 67 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:1.f]; 68 | //back drop view 69 | CGAffineTransform transform; 70 | if (!_shiftBackDropView) { 71 | transform = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 72 | }else { 73 | CGAffineTransform scale = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 74 | CGAffineTransform shift = [self shiftBackDropViewWithPercentage:0]; 75 | transform = CGAffineTransformConcat(scale, shift); 76 | } 77 | _backDropView.alpha = _backDropViewAlpha; 78 | _backDropView.transform = transform; 79 | }completion:^(BOOL finished){ 80 | _appered = YES; 81 | //User intraction of superView 82 | _backDropView.userInteractionEnabled = NO; 83 | }]; 84 | } 85 | } 86 | 87 | - (void)initialSetup 88 | { 89 | //initial property value 90 | _slideInDirection = RASlideInDirectionBottomToTop; 91 | _shiftBackDropView = NO; 92 | _animationDuration = .3f; 93 | _backdropViewScaleReductionRatio = .9f; 94 | _shiftBackDropViewValue = 100.f; 95 | _backDropViewAlpha = 0; 96 | } 97 | 98 | - (void)configure 99 | { 100 | //initial alpha 101 | self.view.alpha = 0; 102 | 103 | //modal style 104 | self.modalPresentationStyle = UIModalPresentationCurrentContext; 105 | 106 | //shadow 107 | self.view.layer.shadowColor = [UIColor blackColor].CGColor; 108 | self.view.layer.shadowOffset = [self shadowOffsetByDirection]; 109 | self.view.layer.shadowOpacity = .5f; 110 | self.view.layer.shadowRadius = 2.f; 111 | self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath; 112 | self.view.layer.shouldRasterize = YES; 113 | self.view.layer.rasterizationScale = [UIScreen mainScreen].scale; 114 | 115 | //pan Gesture 116 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panTransitionView:)]; 117 | [self.view addGestureRecognizer:pan]; 118 | } 119 | 120 | - (CGRect)appearedAnimationStandbyPosition 121 | { 122 | CGSize viewSize = self.view.bounds.size; 123 | switch (_slideInDirection) { 124 | case RASlideInDirectionBottomToTop: 125 | return CGRectMake(0, viewSize.height, viewSize.width, viewSize.height); 126 | case RASlideInDirectionRightToLeft: 127 | return CGRectMake(viewSize.width, 0, viewSize.width, viewSize.height); 128 | case RASlideInDirectionTopToBottom: 129 | return CGRectMake(0, -viewSize.height, viewSize.width, viewSize.height); 130 | case RASlideInDirectionLeftToRight: 131 | return CGRectMake(-viewSize.width, 0, viewSize.width, viewSize.height); 132 | default: 133 | return CGRectMake(0, viewSize.height, viewSize.width, viewSize.height); 134 | } 135 | } 136 | 137 | - (CGSize)shadowOffsetByDirection 138 | { 139 | switch (_slideInDirection) { 140 | case RASlideInDirectionBottomToTop: 141 | return CGSizeMake(0, -4.f); 142 | case RASlideInDirectionRightToLeft: 143 | return CGSizeMake(-4.f, 0); 144 | case RASlideInDirectionTopToBottom: 145 | return CGSizeMake(0, 4.f); 146 | case RASlideInDirectionLeftToRight: 147 | return CGSizeMake(4.f, 0); 148 | default: 149 | return CGSizeMake(0, -4.f); 150 | } 151 | } 152 | 153 | - (UIView *)backDropView 154 | { 155 | UIView *superView; 156 | if (self.presentingViewController){ 157 | superView = self.presentingViewController.view; 158 | return superView; 159 | }else { 160 | NSArray *windows = [UIApplication sharedApplication].windows; 161 | NSInteger index = [windows indexOfObject:self.view.window]; 162 | superView = ((UIWindow *)[windows objectAtIndex:index - 1]).rootViewController.view; 163 | return superView; 164 | } 165 | } 166 | 167 | - (void)panTransitionView:(UIPanGestureRecognizer *)sender 168 | { 169 | CGPoint translation = [sender translationInView:self.view]; 170 | CGPoint velocity = [sender velocityInView:self.view]; 171 | 172 | switch (sender.state) { 173 | case UIGestureRecognizerStateChanged: 174 | //transition 175 | [self viewTransition:translation]; 176 | [self transformSuperViewControllerViewWithPercentage:[self calcPercentage]]; 177 | break; 178 | case UIGestureRecognizerStateCancelled: 179 | case UIGestureRecognizerStateEnded: 180 | if ([self didEndDragingHandllerWithVelocity:velocity]) { 181 | [self forwardTransitedView]; 182 | }else { 183 | [self reverseTransitedView]; 184 | } 185 | break; 186 | default: 187 | break; 188 | } 189 | } 190 | 191 | - (BOOL)didEndDragingHandllerWithVelocity:(CGPoint)velocity 192 | { 193 | switch (_slideInDirection) { 194 | case RASlideInDirectionBottomToTop: 195 | if (velocity.y >= 500.f) { 196 | return YES; 197 | } 198 | return NO; 199 | case RASlideInDirectionRightToLeft: 200 | if (velocity.x >= 500.f) { 201 | return YES; 202 | } 203 | return NO; 204 | case RASlideInDirectionTopToBottom: 205 | if (velocity.y <= -500.f) { 206 | return YES; 207 | } 208 | return NO; 209 | case RASlideInDirectionLeftToRight: 210 | if (velocity.x <= -500.f) { 211 | return YES; 212 | } 213 | return NO; 214 | default: 215 | if (velocity.y >= 500.f) { 216 | return YES; 217 | } 218 | return NO; 219 | } 220 | } 221 | 222 | - (CGFloat)calcPercentage 223 | { 224 | switch (_slideInDirection) { 225 | case RASlideInDirectionBottomToTop: 226 | return self.view.frame.origin.y / [UIScreen mainScreen].bounds.size.height; 227 | break; 228 | case RASlideInDirectionRightToLeft: 229 | return self.view.frame.origin.x / [UIScreen mainScreen].bounds.size.width; 230 | break; 231 | case RASlideInDirectionTopToBottom: 232 | return (-self.view.frame.origin.y) / [UIScreen mainScreen].bounds.size.height; 233 | break; 234 | case RASlideInDirectionLeftToRight: 235 | return (-self.view.frame.origin.x) / [UIScreen mainScreen].bounds.size.width; 236 | break; 237 | default: 238 | return self.view.frame.origin.y / [UIScreen mainScreen].bounds.size.height; 239 | break; 240 | } 241 | } 242 | 243 | - (void)viewTransition:(CGPoint)translation 244 | { 245 | //transition 246 | switch (_slideInDirection) { 247 | case RASlideInDirectionBottomToTop: 248 | self.view.transform = CGAffineTransformMakeTranslation(0, translation.y); 249 | if (self.view.frame.origin.y <= 0) { 250 | self.view.transform = CGAffineTransformIdentity; 251 | } 252 | break; 253 | case RASlideInDirectionRightToLeft: 254 | self.view.transform = CGAffineTransformMakeTranslation(translation.x, 0); 255 | if (self.view.frame.origin.x <= 0) { 256 | self.view.transform = CGAffineTransformIdentity; 257 | } 258 | break; 259 | case RASlideInDirectionTopToBottom: 260 | self.view.transform = CGAffineTransformMakeTranslation(0, translation.y); 261 | if (self.view.frame.origin.y >= 0) { 262 | self.view.transform = CGAffineTransformIdentity; 263 | } 264 | break; 265 | case RASlideInDirectionLeftToRight: 266 | self.view.transform = CGAffineTransformMakeTranslation(translation.x, 0); 267 | if (self.view.frame.origin.x >= 0) { 268 | self.view.transform = CGAffineTransformIdentity; 269 | } 270 | break; 271 | default: 272 | self.view.transform = CGAffineTransformMakeTranslation(0, translation.y); 273 | if (self.view.frame.origin.y <= 0) { 274 | self.view.transform = CGAffineTransformIdentity; 275 | } 276 | break; 277 | } 278 | } 279 | 280 | - (void)transformSuperViewControllerViewWithPercentage:(CGFloat)percentage 281 | { 282 | CGFloat alphaDiff = (1.f - _backDropViewAlpha) * (1.f - percentage); 283 | _backDropView.alpha = 1.f - alphaDiff; 284 | CGAffineTransform transform; 285 | if (!_shiftBackDropView) { 286 | transform = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio)*percentage), _backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio)*percentage)); 287 | }else { 288 | CGAffineTransform scale = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio) * percentage), _backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio) * percentage)); 289 | CGAffineTransform shift = [self shiftBackDropViewWithPercentage:percentage]; 290 | transform = CGAffineTransformConcat(scale, shift); 291 | } 292 | _backDropView.transform = transform; 293 | if (!self.presentingViewController) 294 | { 295 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:0]; 296 | } 297 | } 298 | 299 | - (CGAffineTransform)shiftBackDropViewWithPercentage:(CGFloat)percetage 300 | { 301 | CGAffineTransform shift; 302 | switch (self.slideInDirection) { 303 | case RASlideInDirectionBottomToTop: 304 | shift = CGAffineTransformMakeTranslation(0, (1.f - percetage) * -_shiftBackDropViewValue); 305 | return shift; 306 | case RASlideInDirectionRightToLeft: 307 | shift = CGAffineTransformMakeTranslation((1.f - percetage) * -_shiftBackDropViewValue, 0); 308 | return shift; 309 | case RASlideInDirectionTopToBottom: 310 | shift = CGAffineTransformMakeTranslation(0, (1.f - percetage) * _shiftBackDropViewValue); 311 | return shift; 312 | case RASlideInDirectionLeftToRight: 313 | shift = CGAffineTransformMakeTranslation((1.f - percetage) * _shiftBackDropViewValue, 0); 314 | return shift; 315 | default: 316 | shift = CGAffineTransformMakeTranslation(0, (1.f - percetage) * -_shiftBackDropViewValue); 317 | return shift; 318 | } 319 | } 320 | 321 | - (void)reverseTransitedView 322 | { 323 | [UIView animateWithDuration:_animationDuration delay:0.f options:UIViewAnimationOptionCurveEaseOut animations:^{ 324 | self.view.transform = CGAffineTransformIdentity; 325 | _backDropView.alpha = _backDropViewAlpha; 326 | CGAffineTransform transform; 327 | if (!_shiftBackDropView) { 328 | transform = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 329 | }else { 330 | CGAffineTransform scale = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 331 | CGAffineTransform shift = [self shiftBackDropViewWithPercentage:0]; 332 | transform = CGAffineTransformConcat(scale, shift); 333 | } 334 | _backDropView.transform = transform; 335 | }completion:^(BOOL finished){ 336 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:1.f]; 337 | }]; 338 | } 339 | 340 | - (void)forwardTransitedView 341 | { 342 | [UIView animateWithDuration:_animationDuration delay:0.f options:UIViewAnimationOptionCurveEaseOut animations:^{ 343 | if (self.presentingViewController) { 344 | self.view.transform = [self forwardTransformByDirection]; 345 | }else { 346 | self.view.transform = CGAffineTransformIdentity; 347 | self.view.window.transform = [self forwardTransformByDirection]; 348 | } 349 | _backDropView.alpha = 1.f; 350 | _backDropView.transform = CGAffineTransformIdentity; 351 | }completion:^(BOOL finised){ 352 | _backDropView.userInteractionEnabled = YES; 353 | if (self.presentingViewController) { 354 | [self dismissViewControllerAnimated:NO completion:nil]; 355 | }else { 356 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:0]; 357 | self.view.window.hidden = YES; 358 | } 359 | }]; 360 | } 361 | 362 | - (CGAffineTransform)forwardTransformByDirection 363 | { 364 | switch (_slideInDirection) { 365 | case RASlideInDirectionBottomToTop: 366 | return CGAffineTransformMakeTranslation(0, [UIScreen mainScreen].bounds.size.height); 367 | break; 368 | case RASlideInDirectionRightToLeft: 369 | return CGAffineTransformMakeTranslation([UIScreen mainScreen].bounds.size.width, 0); 370 | break; 371 | case RASlideInDirectionTopToBottom: 372 | return CGAffineTransformMakeTranslation(0, -[UIScreen mainScreen].bounds.size.height); 373 | break; 374 | case RASlideInDirectionLeftToRight: 375 | return CGAffineTransformMakeTranslation(-[UIScreen mainScreen].bounds.size.width, 0); 376 | break; 377 | default: 378 | return CGAffineTransformMakeTranslation(0, [UIScreen mainScreen].bounds.size.height); 379 | break; 380 | } 381 | } 382 | 383 | @end 384 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo/RASlideInViewController/RASlideInViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACardViewController.m 3 | // RACardViewController 4 | // 5 | // Created by Ryo Aoyama on 4/28/14. 6 | // Copyright (c) 2014 Ryo Aoyama. All rights reserved. 7 | // 8 | 9 | #import "RASlideInViewController.h" 10 | 11 | @interface RASlideInViewController () 12 | 13 | @property (nonatomic, assign) BOOL appered; 14 | 15 | @end 16 | 17 | @implementation RASlideInViewController 18 | { 19 | UIView *_backDropView; 20 | } 21 | 22 | - (id)initWithCoder:(NSCoder *)aDecoder 23 | { 24 | self = [super initWithCoder:aDecoder]; 25 | if (self) { 26 | //do any setup 27 | [self initialSetup]; 28 | } 29 | return self; 30 | } 31 | 32 | - (id)init 33 | { 34 | self = [super init]; 35 | if (self) { 36 | //do any setup 37 | [self initialSetup]; 38 | } 39 | return self; 40 | } 41 | 42 | - (void)viewDidLoad 43 | { 44 | [super viewDidLoad]; 45 | 46 | //configre 47 | [self configure]; 48 | } 49 | 50 | - (void)viewDidAppear:(BOOL)animated 51 | { 52 | //back drop view 53 | _backDropView = [self backDropView]; 54 | if (!_appered) 55 | { 56 | //alpha 57 | self.view.alpha = 1.f; 58 | 59 | //backDropView superview alpha 0 60 | self.presentingViewController.presentingViewController.view.alpha = 0; 61 | 62 | //animation 63 | [UIView animateWithDuration:_animationDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 64 | CGSize viewSize = self.view.bounds.size; 65 | self.view.frame = [self appearedAnimationStandbyPosition]; 66 | self.view.frame = CGRectMake(0, 0, viewSize.width, viewSize.height); 67 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:1.f]; 68 | //back drop view 69 | CGAffineTransform transform; 70 | if (!_shiftBackDropView) { 71 | transform = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 72 | }else { 73 | CGAffineTransform scale = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 74 | CGAffineTransform shift = [self shiftBackDropViewWithPercentage:0]; 75 | transform = CGAffineTransformConcat(scale, shift); 76 | } 77 | _backDropView.alpha = _backDropViewAlpha; 78 | _backDropView.transform = transform; 79 | }completion:^(BOOL finished){ 80 | _appered = YES; 81 | //User intraction of superView 82 | _backDropView.userInteractionEnabled = NO; 83 | }]; 84 | } 85 | } 86 | 87 | - (void)initialSetup 88 | { 89 | //initial property value 90 | _slideInDirection = RASlideInDirectionBottomToTop; 91 | _shiftBackDropView = NO; 92 | _animationDuration = .3f; 93 | _backdropViewScaleReductionRatio = .9f; 94 | _shiftBackDropViewValue = 100.f; 95 | _backDropViewAlpha = 0; 96 | } 97 | 98 | - (void)configure 99 | { 100 | //initial alpha 101 | self.view.alpha = 0; 102 | 103 | //modal style 104 | self.modalPresentationStyle = UIModalPresentationCurrentContext; 105 | 106 | //shadow 107 | self.view.layer.shadowColor = [UIColor blackColor].CGColor; 108 | self.view.layer.shadowOffset = [self shadowOffsetByDirection]; 109 | self.view.layer.shadowOpacity = .5f; 110 | self.view.layer.shadowRadius = 2.f; 111 | self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath; 112 | self.view.layer.shouldRasterize = YES; 113 | self.view.layer.rasterizationScale = [UIScreen mainScreen].scale; 114 | 115 | //pan Gesture 116 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panTransitionView:)]; 117 | [self.view addGestureRecognizer:pan]; 118 | } 119 | 120 | - (CGRect)appearedAnimationStandbyPosition 121 | { 122 | CGSize viewSize = self.view.bounds.size; 123 | switch (_slideInDirection) { 124 | case RASlideInDirectionBottomToTop: 125 | return CGRectMake(0, viewSize.height, viewSize.width, viewSize.height); 126 | case RASlideInDirectionRightToLeft: 127 | return CGRectMake(viewSize.width, 0, viewSize.width, viewSize.height); 128 | case RASlideInDirectionTopToBottom: 129 | return CGRectMake(0, -viewSize.height, viewSize.width, viewSize.height); 130 | case RASlideInDirectionLeftToRight: 131 | return CGRectMake(-viewSize.width, 0, viewSize.width, viewSize.height); 132 | default: 133 | return CGRectMake(0, viewSize.height, viewSize.width, viewSize.height); 134 | } 135 | } 136 | 137 | - (CGSize)shadowOffsetByDirection 138 | { 139 | switch (_slideInDirection) { 140 | case RASlideInDirectionBottomToTop: 141 | return CGSizeMake(0, -4.f); 142 | case RASlideInDirectionRightToLeft: 143 | return CGSizeMake(-4.f, 0); 144 | case RASlideInDirectionTopToBottom: 145 | return CGSizeMake(0, 4.f); 146 | case RASlideInDirectionLeftToRight: 147 | return CGSizeMake(4.f, 0); 148 | default: 149 | return CGSizeMake(0, -4.f); 150 | } 151 | } 152 | 153 | - (UIView *)backDropView 154 | { 155 | UIView *superView; 156 | if (self.presentingViewController){ 157 | superView = self.presentingViewController.view; 158 | return superView; 159 | }else { 160 | NSArray *windows = [UIApplication sharedApplication].windows; 161 | NSInteger index = [windows indexOfObject:self.view.window]; 162 | superView = ((UIWindow *)[windows objectAtIndex:index - 1]).rootViewController.view; 163 | return superView; 164 | } 165 | } 166 | 167 | - (void)panTransitionView:(UIPanGestureRecognizer *)sender 168 | { 169 | CGPoint translation = [sender translationInView:self.view]; 170 | CGPoint velocity = [sender velocityInView:self.view]; 171 | 172 | switch (sender.state) { 173 | case UIGestureRecognizerStateChanged: 174 | //transition 175 | [self viewTransition:translation]; 176 | [self transformSuperViewControllerViewWithPercentage:[self calcPercentage]]; 177 | break; 178 | case UIGestureRecognizerStateCancelled: 179 | case UIGestureRecognizerStateEnded: 180 | if ([self didEndDragingHandllerWithVelocity:velocity]) { 181 | [self forwardTransitedView]; 182 | }else { 183 | [self reverseTransitedView]; 184 | } 185 | break; 186 | default: 187 | break; 188 | } 189 | } 190 | 191 | - (BOOL)didEndDragingHandllerWithVelocity:(CGPoint)velocity 192 | { 193 | switch (_slideInDirection) { 194 | case RASlideInDirectionBottomToTop: 195 | if (velocity.y >= 500.f) { 196 | return YES; 197 | } 198 | return NO; 199 | case RASlideInDirectionRightToLeft: 200 | if (velocity.x >= 500.f) { 201 | return YES; 202 | } 203 | return NO; 204 | case RASlideInDirectionTopToBottom: 205 | if (velocity.y <= -500.f) { 206 | return YES; 207 | } 208 | return NO; 209 | case RASlideInDirectionLeftToRight: 210 | if (velocity.x <= -500.f) { 211 | return YES; 212 | } 213 | return NO; 214 | default: 215 | if (velocity.y >= 500.f) { 216 | return YES; 217 | } 218 | return NO; 219 | } 220 | } 221 | 222 | - (CGFloat)calcPercentage 223 | { 224 | switch (_slideInDirection) { 225 | case RASlideInDirectionBottomToTop: 226 | return self.view.frame.origin.y / [UIScreen mainScreen].bounds.size.height; 227 | break; 228 | case RASlideInDirectionRightToLeft: 229 | return self.view.frame.origin.x / [UIScreen mainScreen].bounds.size.width; 230 | break; 231 | case RASlideInDirectionTopToBottom: 232 | return (-self.view.frame.origin.y) / [UIScreen mainScreen].bounds.size.height; 233 | break; 234 | case RASlideInDirectionLeftToRight: 235 | return (-self.view.frame.origin.x) / [UIScreen mainScreen].bounds.size.width; 236 | break; 237 | default: 238 | return self.view.frame.origin.y / [UIScreen mainScreen].bounds.size.height; 239 | break; 240 | } 241 | } 242 | 243 | - (void)viewTransition:(CGPoint)translation 244 | { 245 | //transition 246 | switch (_slideInDirection) { 247 | case RASlideInDirectionBottomToTop: 248 | self.view.transform = CGAffineTransformMakeTranslation(0, translation.y); 249 | if (self.view.frame.origin.y <= 0) { 250 | self.view.transform = CGAffineTransformIdentity; 251 | } 252 | break; 253 | case RASlideInDirectionRightToLeft: 254 | self.view.transform = CGAffineTransformMakeTranslation(translation.x, 0); 255 | if (self.view.frame.origin.x <= 0) { 256 | self.view.transform = CGAffineTransformIdentity; 257 | } 258 | break; 259 | case RASlideInDirectionTopToBottom: 260 | self.view.transform = CGAffineTransformMakeTranslation(0, translation.y); 261 | if (self.view.frame.origin.y >= 0) { 262 | self.view.transform = CGAffineTransformIdentity; 263 | } 264 | break; 265 | case RASlideInDirectionLeftToRight: 266 | self.view.transform = CGAffineTransformMakeTranslation(translation.x, 0); 267 | if (self.view.frame.origin.x >= 0) { 268 | self.view.transform = CGAffineTransformIdentity; 269 | } 270 | break; 271 | default: 272 | self.view.transform = CGAffineTransformMakeTranslation(0, translation.y); 273 | if (self.view.frame.origin.y <= 0) { 274 | self.view.transform = CGAffineTransformIdentity; 275 | } 276 | break; 277 | } 278 | } 279 | 280 | - (void)transformSuperViewControllerViewWithPercentage:(CGFloat)percentage 281 | { 282 | CGFloat alphaDiff = (1.f - _backDropViewAlpha) * (1.f - percentage); 283 | _backDropView.alpha = 1.f - alphaDiff; 284 | CGAffineTransform transform; 285 | if (!_shiftBackDropView) { 286 | transform = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio)*percentage), _backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio)*percentage)); 287 | }else { 288 | CGAffineTransform scale = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio) * percentage), _backdropViewScaleReductionRatio + ((1.f - _backdropViewScaleReductionRatio) * percentage)); 289 | CGAffineTransform shift = [self shiftBackDropViewWithPercentage:percentage]; 290 | transform = CGAffineTransformConcat(scale, shift); 291 | } 292 | _backDropView.transform = transform; 293 | if (!self.presentingViewController) 294 | { 295 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:0]; 296 | } 297 | } 298 | 299 | - (CGAffineTransform)shiftBackDropViewWithPercentage:(CGFloat)percetage 300 | { 301 | CGAffineTransform shift; 302 | switch (self.slideInDirection) { 303 | case RASlideInDirectionBottomToTop: 304 | shift = CGAffineTransformMakeTranslation(0, (1.f - percetage) * -_shiftBackDropViewValue); 305 | return shift; 306 | case RASlideInDirectionRightToLeft: 307 | shift = CGAffineTransformMakeTranslation((1.f - percetage) * -_shiftBackDropViewValue, 0); 308 | return shift; 309 | case RASlideInDirectionTopToBottom: 310 | shift = CGAffineTransformMakeTranslation(0, (1.f - percetage) * _shiftBackDropViewValue); 311 | return shift; 312 | case RASlideInDirectionLeftToRight: 313 | shift = CGAffineTransformMakeTranslation((1.f - percetage) * _shiftBackDropViewValue, 0); 314 | return shift; 315 | default: 316 | shift = CGAffineTransformMakeTranslation(0, (1.f - percetage) * -_shiftBackDropViewValue); 317 | return shift; 318 | } 319 | } 320 | 321 | - (void)reverseTransitedView 322 | { 323 | [UIView animateWithDuration:_animationDuration delay:0.f options:UIViewAnimationOptionCurveEaseOut animations:^{ 324 | self.view.transform = CGAffineTransformIdentity; 325 | _backDropView.alpha = _backDropViewAlpha; 326 | CGAffineTransform transform; 327 | if (!_shiftBackDropView) { 328 | transform = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 329 | }else { 330 | CGAffineTransform scale = CGAffineTransformMakeScale(_backdropViewScaleReductionRatio, _backdropViewScaleReductionRatio); 331 | CGAffineTransform shift = [self shiftBackDropViewWithPercentage:0]; 332 | transform = CGAffineTransformConcat(scale, shift); 333 | } 334 | _backDropView.transform = transform; 335 | }completion:^(BOOL finished){ 336 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:1.f]; 337 | }]; 338 | } 339 | 340 | - (void)forwardTransitedView 341 | { 342 | [UIView animateWithDuration:_animationDuration delay:0.f options:UIViewAnimationOptionCurveEaseOut animations:^{ 343 | if (self.presentingViewController) { 344 | self.view.transform = [self forwardTransformByDirection]; 345 | }else { 346 | self.view.transform = CGAffineTransformIdentity; 347 | self.view.window.transform = [self forwardTransformByDirection]; 348 | } 349 | _backDropView.alpha = 1.f; 350 | _backDropView.transform = CGAffineTransformIdentity; 351 | }completion:^(BOOL finised){ 352 | _backDropView.userInteractionEnabled = YES; 353 | if (self.presentingViewController) { 354 | [self dismissViewControllerAnimated:NO completion:nil]; 355 | }else { 356 | self.view.window.backgroundColor = [UIColor colorWithWhite:0 alpha:0]; 357 | self.view.window.hidden = YES; 358 | } 359 | }]; 360 | } 361 | 362 | - (CGAffineTransform)forwardTransformByDirection 363 | { 364 | switch (_slideInDirection) { 365 | case RASlideInDirectionBottomToTop: 366 | return CGAffineTransformMakeTranslation(0, [UIScreen mainScreen].bounds.size.height); 367 | break; 368 | case RASlideInDirectionRightToLeft: 369 | return CGAffineTransformMakeTranslation([UIScreen mainScreen].bounds.size.width, 0); 370 | break; 371 | case RASlideInDirectionTopToBottom: 372 | return CGAffineTransformMakeTranslation(0, -[UIScreen mainScreen].bounds.size.height); 373 | break; 374 | case RASlideInDirectionLeftToRight: 375 | return CGAffineTransformMakeTranslation(-[UIScreen mainScreen].bounds.size.width, 0); 376 | break; 377 | default: 378 | return CGAffineTransformMakeTranslation(0, [UIScreen mainScreen].bounds.size.height); 379 | break; 380 | } 381 | } 382 | 383 | @end 384 | -------------------------------------------------------------------------------- /RASlideInViewController-Demo/RASlideInViewController-Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2A1C57F01911859B007013D2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A1C57EF1911859B007013D2 /* Foundation.framework */; }; 11 | 2A1C57F21911859B007013D2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A1C57F11911859B007013D2 /* CoreGraphics.framework */; }; 12 | 2A1C57F41911859B007013D2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A1C57F31911859B007013D2 /* UIKit.framework */; }; 13 | 2A1C57FA1911859B007013D2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2A1C57F81911859B007013D2 /* InfoPlist.strings */; }; 14 | 2A1C57FC1911859B007013D2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C57FB1911859B007013D2 /* main.m */; }; 15 | 2A1C58081911859B007013D2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A1C58071911859B007013D2 /* Images.xcassets */; }; 16 | 2A1C580F1911859B007013D2 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A1C580E1911859B007013D2 /* XCTest.framework */; }; 17 | 2A1C58101911859B007013D2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A1C57EF1911859B007013D2 /* Foundation.framework */; }; 18 | 2A1C58111911859B007013D2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A1C57F31911859B007013D2 /* UIKit.framework */; }; 19 | 2A1C58191911859B007013D2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2A1C58171911859B007013D2 /* InfoPlist.strings */; }; 20 | 2A1C581B1911859B007013D2 /* RASlideInViewController_DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C581A1911859B007013D2 /* RASlideInViewController_DemoTests.m */; }; 21 | 2A1C582B191185AF007013D2 /* RANewSlideInViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C5826191185AF007013D2 /* RANewSlideInViewController.m */; }; 22 | 2A1C582C191185AF007013D2 /* RASlideInViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C5828191185AF007013D2 /* RASlideInViewController.m */; }; 23 | 2A1C582D191185AF007013D2 /* RAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C582A191185AF007013D2 /* RAViewController.m */; }; 24 | 2A1C58301911861B007013D2 /* RAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C582F1911861B007013D2 /* RAAppDelegate.m */; }; 25 | 2A1C583219118674007013D2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A1C583119118674007013D2 /* Main.storyboard */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 2A1C58121911859B007013D2 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 2A1C57E41911859B007013D2 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 2A1C57EB1911859B007013D2; 34 | remoteInfo = "RASlideInViewController-Demo"; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 2A1C57EC1911859B007013D2 /* RASlideInViewController-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RASlideInViewController-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 2A1C57EF1911859B007013D2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 2A1C57F11911859B007013D2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | 2A1C57F31911859B007013D2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 2A1C57F71911859B007013D2 /* RASlideInViewController-Demo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RASlideInViewController-Demo-Info.plist"; sourceTree = ""; }; 44 | 2A1C57F91911859B007013D2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 45 | 2A1C57FB1911859B007013D2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | 2A1C57FD1911859B007013D2 /* RASlideInViewController-Demo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RASlideInViewController-Demo-Prefix.pch"; sourceTree = ""; }; 47 | 2A1C58071911859B007013D2 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 48 | 2A1C580D1911859B007013D2 /* RASlideInViewController-DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RASlideInViewController-DemoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 2A1C580E1911859B007013D2 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 50 | 2A1C58161911859B007013D2 /* RASlideInViewController-DemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RASlideInViewController-DemoTests-Info.plist"; sourceTree = ""; }; 51 | 2A1C58181911859B007013D2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 52 | 2A1C581A1911859B007013D2 /* RASlideInViewController_DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RASlideInViewController_DemoTests.m; sourceTree = ""; }; 53 | 2A1C5825191185AF007013D2 /* RANewSlideInViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RANewSlideInViewController.h; path = RASlideInViewController/RANewSlideInViewController.h; sourceTree = ""; }; 54 | 2A1C5826191185AF007013D2 /* RANewSlideInViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RANewSlideInViewController.m; path = RASlideInViewController/RANewSlideInViewController.m; sourceTree = ""; }; 55 | 2A1C5827191185AF007013D2 /* RASlideInViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RASlideInViewController.h; sourceTree = ""; }; 56 | 2A1C5828191185AF007013D2 /* RASlideInViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RASlideInViewController.m; sourceTree = ""; }; 57 | 2A1C5829191185AF007013D2 /* RAViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAViewController.h; path = RASlideInViewController/RAViewController.h; sourceTree = ""; }; 58 | 2A1C582A191185AF007013D2 /* RAViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAViewController.m; path = RASlideInViewController/RAViewController.m; sourceTree = ""; }; 59 | 2A1C582E1911861B007013D2 /* RAAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAAppDelegate.h; sourceTree = ""; }; 60 | 2A1C582F1911861B007013D2 /* RAAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAAppDelegate.m; sourceTree = ""; }; 61 | 2A1C583119118674007013D2 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 2A1C57E91911859B007013D2 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 2A1C57F21911859B007013D2 /* CoreGraphics.framework in Frameworks */, 70 | 2A1C57F41911859B007013D2 /* UIKit.framework in Frameworks */, 71 | 2A1C57F01911859B007013D2 /* Foundation.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 2A1C580A1911859B007013D2 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | 2A1C580F1911859B007013D2 /* XCTest.framework in Frameworks */, 80 | 2A1C58111911859B007013D2 /* UIKit.framework in Frameworks */, 81 | 2A1C58101911859B007013D2 /* Foundation.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | 2A1C57E31911859B007013D2 = { 89 | isa = PBXGroup; 90 | children = ( 91 | 2A1C5824191185AF007013D2 /* RASlideInViewController */, 92 | 2A1C57F51911859B007013D2 /* RASlideInViewController-Demo */, 93 | 2A1C58141911859B007013D2 /* RASlideInViewController-DemoTests */, 94 | 2A1C57EE1911859B007013D2 /* Frameworks */, 95 | 2A1C57ED1911859B007013D2 /* Products */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | 2A1C57ED1911859B007013D2 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 2A1C57EC1911859B007013D2 /* RASlideInViewController-Demo.app */, 103 | 2A1C580D1911859B007013D2 /* RASlideInViewController-DemoTests.xctest */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | 2A1C57EE1911859B007013D2 /* Frameworks */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 2A1C57EF1911859B007013D2 /* Foundation.framework */, 112 | 2A1C57F11911859B007013D2 /* CoreGraphics.framework */, 113 | 2A1C57F31911859B007013D2 /* UIKit.framework */, 114 | 2A1C580E1911859B007013D2 /* XCTest.framework */, 115 | ); 116 | name = Frameworks; 117 | sourceTree = ""; 118 | }; 119 | 2A1C57F51911859B007013D2 /* RASlideInViewController-Demo */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 2A1C582E1911861B007013D2 /* RAAppDelegate.h */, 123 | 2A1C582F1911861B007013D2 /* RAAppDelegate.m */, 124 | 2A1C583119118674007013D2 /* Main.storyboard */, 125 | 2A1C5825191185AF007013D2 /* RANewSlideInViewController.h */, 126 | 2A1C5826191185AF007013D2 /* RANewSlideInViewController.m */, 127 | 2A1C5829191185AF007013D2 /* RAViewController.h */, 128 | 2A1C582A191185AF007013D2 /* RAViewController.m */, 129 | 2A1C58071911859B007013D2 /* Images.xcassets */, 130 | 2A1C57F61911859B007013D2 /* Supporting Files */, 131 | ); 132 | path = "RASlideInViewController-Demo"; 133 | sourceTree = ""; 134 | }; 135 | 2A1C57F61911859B007013D2 /* Supporting Files */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 2A1C57F71911859B007013D2 /* RASlideInViewController-Demo-Info.plist */, 139 | 2A1C57F81911859B007013D2 /* InfoPlist.strings */, 140 | 2A1C57FB1911859B007013D2 /* main.m */, 141 | 2A1C57FD1911859B007013D2 /* RASlideInViewController-Demo-Prefix.pch */, 142 | ); 143 | name = "Supporting Files"; 144 | sourceTree = ""; 145 | }; 146 | 2A1C58141911859B007013D2 /* RASlideInViewController-DemoTests */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 2A1C581A1911859B007013D2 /* RASlideInViewController_DemoTests.m */, 150 | 2A1C58151911859B007013D2 /* Supporting Files */, 151 | ); 152 | path = "RASlideInViewController-DemoTests"; 153 | sourceTree = ""; 154 | }; 155 | 2A1C58151911859B007013D2 /* Supporting Files */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 2A1C58161911859B007013D2 /* RASlideInViewController-DemoTests-Info.plist */, 159 | 2A1C58171911859B007013D2 /* InfoPlist.strings */, 160 | ); 161 | name = "Supporting Files"; 162 | sourceTree = ""; 163 | }; 164 | 2A1C5824191185AF007013D2 /* RASlideInViewController */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 2A1C5827191185AF007013D2 /* RASlideInViewController.h */, 168 | 2A1C5828191185AF007013D2 /* RASlideInViewController.m */, 169 | ); 170 | name = RASlideInViewController; 171 | path = "RASlideInViewController-Demo/RASlideInViewController"; 172 | sourceTree = ""; 173 | }; 174 | /* End PBXGroup section */ 175 | 176 | /* Begin PBXNativeTarget section */ 177 | 2A1C57EB1911859B007013D2 /* RASlideInViewController-Demo */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 2A1C581E1911859B007013D2 /* Build configuration list for PBXNativeTarget "RASlideInViewController-Demo" */; 180 | buildPhases = ( 181 | 2A1C57E81911859B007013D2 /* Sources */, 182 | 2A1C57E91911859B007013D2 /* Frameworks */, 183 | 2A1C57EA1911859B007013D2 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | ); 189 | name = "RASlideInViewController-Demo"; 190 | productName = "RASlideInViewController-Demo"; 191 | productReference = 2A1C57EC1911859B007013D2 /* RASlideInViewController-Demo.app */; 192 | productType = "com.apple.product-type.application"; 193 | }; 194 | 2A1C580C1911859B007013D2 /* RASlideInViewController-DemoTests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = 2A1C58211911859B007013D2 /* Build configuration list for PBXNativeTarget "RASlideInViewController-DemoTests" */; 197 | buildPhases = ( 198 | 2A1C58091911859B007013D2 /* Sources */, 199 | 2A1C580A1911859B007013D2 /* Frameworks */, 200 | 2A1C580B1911859B007013D2 /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | 2A1C58131911859B007013D2 /* PBXTargetDependency */, 206 | ); 207 | name = "RASlideInViewController-DemoTests"; 208 | productName = "RASlideInViewController-DemoTests"; 209 | productReference = 2A1C580D1911859B007013D2 /* RASlideInViewController-DemoTests.xctest */; 210 | productType = "com.apple.product-type.bundle.unit-test"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | 2A1C57E41911859B007013D2 /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | CLASSPREFIX = RA; 219 | LastUpgradeCheck = 0510; 220 | ORGANIZATIONNAME = "Ryo Aoyama"; 221 | TargetAttributes = { 222 | 2A1C580C1911859B007013D2 = { 223 | TestTargetID = 2A1C57EB1911859B007013D2; 224 | }; 225 | }; 226 | }; 227 | buildConfigurationList = 2A1C57E71911859B007013D2 /* Build configuration list for PBXProject "RASlideInViewController-Demo" */; 228 | compatibilityVersion = "Xcode 3.2"; 229 | developmentRegion = English; 230 | hasScannedForEncodings = 0; 231 | knownRegions = ( 232 | en, 233 | Base, 234 | ); 235 | mainGroup = 2A1C57E31911859B007013D2; 236 | productRefGroup = 2A1C57ED1911859B007013D2 /* Products */; 237 | projectDirPath = ""; 238 | projectRoot = ""; 239 | targets = ( 240 | 2A1C57EB1911859B007013D2 /* RASlideInViewController-Demo */, 241 | 2A1C580C1911859B007013D2 /* RASlideInViewController-DemoTests */, 242 | ); 243 | }; 244 | /* End PBXProject section */ 245 | 246 | /* Begin PBXResourcesBuildPhase section */ 247 | 2A1C57EA1911859B007013D2 /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | 2A1C583219118674007013D2 /* Main.storyboard in Resources */, 252 | 2A1C58081911859B007013D2 /* Images.xcassets in Resources */, 253 | 2A1C57FA1911859B007013D2 /* InfoPlist.strings in Resources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | 2A1C580B1911859B007013D2 /* Resources */ = { 258 | isa = PBXResourcesBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | 2A1C58191911859B007013D2 /* InfoPlist.strings in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXResourcesBuildPhase section */ 266 | 267 | /* Begin PBXSourcesBuildPhase section */ 268 | 2A1C57E81911859B007013D2 /* Sources */ = { 269 | isa = PBXSourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | 2A1C57FC1911859B007013D2 /* main.m in Sources */, 273 | 2A1C582C191185AF007013D2 /* RASlideInViewController.m in Sources */, 274 | 2A1C582B191185AF007013D2 /* RANewSlideInViewController.m in Sources */, 275 | 2A1C58301911861B007013D2 /* RAAppDelegate.m in Sources */, 276 | 2A1C582D191185AF007013D2 /* RAViewController.m in Sources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | 2A1C58091911859B007013D2 /* Sources */ = { 281 | isa = PBXSourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 2A1C581B1911859B007013D2 /* RASlideInViewController_DemoTests.m in Sources */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | /* End PBXSourcesBuildPhase section */ 289 | 290 | /* Begin PBXTargetDependency section */ 291 | 2A1C58131911859B007013D2 /* PBXTargetDependency */ = { 292 | isa = PBXTargetDependency; 293 | target = 2A1C57EB1911859B007013D2 /* RASlideInViewController-Demo */; 294 | targetProxy = 2A1C58121911859B007013D2 /* PBXContainerItemProxy */; 295 | }; 296 | /* End PBXTargetDependency section */ 297 | 298 | /* Begin PBXVariantGroup section */ 299 | 2A1C57F81911859B007013D2 /* InfoPlist.strings */ = { 300 | isa = PBXVariantGroup; 301 | children = ( 302 | 2A1C57F91911859B007013D2 /* en */, 303 | ); 304 | name = InfoPlist.strings; 305 | sourceTree = ""; 306 | }; 307 | 2A1C58171911859B007013D2 /* InfoPlist.strings */ = { 308 | isa = PBXVariantGroup; 309 | children = ( 310 | 2A1C58181911859B007013D2 /* en */, 311 | ); 312 | name = InfoPlist.strings; 313 | sourceTree = ""; 314 | }; 315 | /* End PBXVariantGroup section */ 316 | 317 | /* Begin XCBuildConfiguration section */ 318 | 2A1C581C1911859B007013D2 /* Debug */ = { 319 | isa = XCBuildConfiguration; 320 | buildSettings = { 321 | ALWAYS_SEARCH_USER_PATHS = NO; 322 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 323 | CLANG_CXX_LIBRARY = "libc++"; 324 | CLANG_ENABLE_MODULES = YES; 325 | CLANG_ENABLE_OBJC_ARC = YES; 326 | CLANG_WARN_BOOL_CONVERSION = YES; 327 | CLANG_WARN_CONSTANT_CONVERSION = YES; 328 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 329 | CLANG_WARN_EMPTY_BODY = YES; 330 | CLANG_WARN_ENUM_CONVERSION = YES; 331 | CLANG_WARN_INT_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 335 | COPY_PHASE_STRIP = NO; 336 | GCC_C_LANGUAGE_STANDARD = gnu99; 337 | GCC_DYNAMIC_NO_PIC = NO; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 344 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 345 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 346 | GCC_WARN_UNDECLARED_SELECTOR = YES; 347 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 348 | GCC_WARN_UNUSED_FUNCTION = YES; 349 | GCC_WARN_UNUSED_VARIABLE = YES; 350 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | }; 354 | name = Debug; 355 | }; 356 | 2A1C581D1911859B007013D2 /* Release */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ALWAYS_SEARCH_USER_PATHS = NO; 360 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 361 | CLANG_CXX_LIBRARY = "libc++"; 362 | CLANG_ENABLE_MODULES = YES; 363 | CLANG_ENABLE_OBJC_ARC = YES; 364 | CLANG_WARN_BOOL_CONVERSION = YES; 365 | CLANG_WARN_CONSTANT_CONVERSION = YES; 366 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 367 | CLANG_WARN_EMPTY_BODY = YES; 368 | CLANG_WARN_ENUM_CONVERSION = YES; 369 | CLANG_WARN_INT_CONVERSION = YES; 370 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 371 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 372 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 373 | COPY_PHASE_STRIP = YES; 374 | ENABLE_NS_ASSERTIONS = NO; 375 | GCC_C_LANGUAGE_STANDARD = gnu99; 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 383 | SDKROOT = iphoneos; 384 | VALIDATE_PRODUCT = YES; 385 | }; 386 | name = Release; 387 | }; 388 | 2A1C581F1911859B007013D2 /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 392 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 393 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 394 | GCC_PREFIX_HEADER = "RASlideInViewController-Demo/RASlideInViewController-Demo-Prefix.pch"; 395 | INFOPLIST_FILE = "RASlideInViewController-Demo/RASlideInViewController-Demo-Info.plist"; 396 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | WRAPPER_EXTENSION = app; 399 | }; 400 | name = Debug; 401 | }; 402 | 2A1C58201911859B007013D2 /* Release */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 407 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 408 | GCC_PREFIX_HEADER = "RASlideInViewController-Demo/RASlideInViewController-Demo-Prefix.pch"; 409 | INFOPLIST_FILE = "RASlideInViewController-Demo/RASlideInViewController-Demo-Info.plist"; 410 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 411 | PRODUCT_NAME = "$(TARGET_NAME)"; 412 | WRAPPER_EXTENSION = app; 413 | }; 414 | name = Release; 415 | }; 416 | 2A1C58221911859B007013D2 /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | buildSettings = { 419 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RASlideInViewController-Demo.app/RASlideInViewController-Demo"; 420 | FRAMEWORK_SEARCH_PATHS = ( 421 | "$(SDKROOT)/Developer/Library/Frameworks", 422 | "$(inherited)", 423 | "$(DEVELOPER_FRAMEWORKS_DIR)", 424 | ); 425 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 426 | GCC_PREFIX_HEADER = "RASlideInViewController-Demo/RASlideInViewController-Demo-Prefix.pch"; 427 | GCC_PREPROCESSOR_DEFINITIONS = ( 428 | "DEBUG=1", 429 | "$(inherited)", 430 | ); 431 | INFOPLIST_FILE = "RASlideInViewController-DemoTests/RASlideInViewController-DemoTests-Info.plist"; 432 | PRODUCT_NAME = "$(TARGET_NAME)"; 433 | TEST_HOST = "$(BUNDLE_LOADER)"; 434 | WRAPPER_EXTENSION = xctest; 435 | }; 436 | name = Debug; 437 | }; 438 | 2A1C58231911859B007013D2 /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RASlideInViewController-Demo.app/RASlideInViewController-Demo"; 442 | FRAMEWORK_SEARCH_PATHS = ( 443 | "$(SDKROOT)/Developer/Library/Frameworks", 444 | "$(inherited)", 445 | "$(DEVELOPER_FRAMEWORKS_DIR)", 446 | ); 447 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 448 | GCC_PREFIX_HEADER = "RASlideInViewController-Demo/RASlideInViewController-Demo-Prefix.pch"; 449 | INFOPLIST_FILE = "RASlideInViewController-DemoTests/RASlideInViewController-DemoTests-Info.plist"; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | TEST_HOST = "$(BUNDLE_LOADER)"; 452 | WRAPPER_EXTENSION = xctest; 453 | }; 454 | name = Release; 455 | }; 456 | /* End XCBuildConfiguration section */ 457 | 458 | /* Begin XCConfigurationList section */ 459 | 2A1C57E71911859B007013D2 /* Build configuration list for PBXProject "RASlideInViewController-Demo" */ = { 460 | isa = XCConfigurationList; 461 | buildConfigurations = ( 462 | 2A1C581C1911859B007013D2 /* Debug */, 463 | 2A1C581D1911859B007013D2 /* Release */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | 2A1C581E1911859B007013D2 /* Build configuration list for PBXNativeTarget "RASlideInViewController-Demo" */ = { 469 | isa = XCConfigurationList; 470 | buildConfigurations = ( 471 | 2A1C581F1911859B007013D2 /* Debug */, 472 | 2A1C58201911859B007013D2 /* Release */, 473 | ); 474 | defaultConfigurationIsVisible = 0; 475 | defaultConfigurationName = Release; 476 | }; 477 | 2A1C58211911859B007013D2 /* Build configuration list for PBXNativeTarget "RASlideInViewController-DemoTests" */ = { 478 | isa = XCConfigurationList; 479 | buildConfigurations = ( 480 | 2A1C58221911859B007013D2 /* Debug */, 481 | 2A1C58231911859B007013D2 /* Release */, 482 | ); 483 | defaultConfigurationIsVisible = 0; 484 | defaultConfigurationName = Release; 485 | }; 486 | /* End XCConfigurationList section */ 487 | }; 488 | rootObject = 2A1C57E41911859B007013D2 /* Project object */; 489 | } 490 | --------------------------------------------------------------------------------