Skip to content

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

License

Notifications You must be signed in to change notification settings

K6F/KFScaleSegue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, Fan.Khiyuan@gmail.com

License

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published