Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 1.89 KB

README.md

File metadata and controls

73 lines (53 loc) · 1.89 KB

KFScaleSegue

CI Status Version License Platform

Description

Segue used in storyboard, scale old controller's view and show it's snapshot in new view;

Demo Gif

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Step One

In storyboard, create a custom segue with class: KFScaleSegue

Step One

Step Two

In Left or Right View, import a category of UIViewController

#import "UIViewController+KFScaleSegue.h"

Step Three

Implement Protocal KFScaleSegueDelegate which is already import in UIViewController+KFScaleSegue.h

Direction define:

typedef NS_ENUM(NSInteger, KFScaleSegueMoveDirection) {
    KFScaleSegueMoveFromLeft,
    KFScaleSegueMoveFromRight
};

Protocal methods:

In left side viewcontroller

#pragma mark - KFScaleSegueDelegate
-(KFScaleSegueMoveDirection)kf_DirectionToMove{
    return KFScaleSegueMoveFromLeft;
}
-(CGFloat)kf_ScaleOfHoldView{
	return 0.8f;
}
-(CGFloat)kf_WidthRemainOfHoldView{
	return 96.f;
}

Requirements

iOS >= 7.0

Installation

KFScaleSegue is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "KFScaleSegue"

Author

K6F, [email protected]

License

KFScaleSegue is available under the MIT license. See the LICENSE file for more info.