Segue used in storyboard, scale old controller's view and show it's snapshot in new view;
To run the example project, clone the repo, and run pod install
from the Example directory first.
In storyboard, create a custom segue with class: KFScaleSegue
In Left or Right View, import a category of UIViewController
#import "UIViewController+KFScaleSegue.h"
Implement Protocal KFScaleSegueDelegate which is already import in UIViewController+KFScaleSegue.h
typedef NS_ENUM(NSInteger, KFScaleSegueMoveDirection) {
KFScaleSegueMoveFromLeft,
KFScaleSegueMoveFromRight
};
In left side viewcontroller
#pragma mark - KFScaleSegueDelegate
-(KFScaleSegueMoveDirection)kf_DirectionToMove{
return KFScaleSegueMoveFromLeft;
}
-(CGFloat)kf_ScaleOfHoldView{
return 0.8f;
}
-(CGFloat)kf_WidthRemainOfHoldView{
return 96.f;
}
KFScaleSegue is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "KFScaleSegue"
K6F, [email protected]
KFScaleSegue is available under the MIT license. See the LICENSE file for more info.