UINavigationController+Animation

This code add custom animation effect to UINavigationController, this code is get from network.

UINavigationController+Animation.h

#import <Foundation/Foundation.h>

@interface UINavigationController (Animation)

- (void) pushViewControllerWithFlip:(UIViewController*) controller;

- (void) popViewControllerWithFlip;

@end

UINavigationController+Animation.m

#import "UINavigationController+Animation.h"

@implementation UINavigationController (Animation)

- (void) pushViewControllerWithFlip:(UIViewController *) controller
{
    [UIView animateWithDuration:0.50
                     animations:^{
                         [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
                         [self pushViewController:controller animated:NO];
                         [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:NO];
                     }];
}

- (void) popViewControllerWithFlip
{
    [UIView animateWithDuration:0.5
                     animations:^{
                         [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
                         [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:NO];
                     }];
    
    [self popViewControllerAnimated:NO];
}

@end
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,568评论 2 45
  • 每个人都有他的特点,每个人都不一样。 时间让我们相遇,世界让我们认识。 特殊的你我,特殊的友谊。
    嘘C橙春0308阅读 321评论 0 4
  • 书名:把时间当作朋友——运用心智获得解放 作者:李笑来 来源:网络下载 本文纲要: 作者从心智的角度来指导人生,由...
    0538王小米阅读 258评论 0 0
  • 望月有思 圆月当空照,思念涌心头 不知故人心,游子归心切 秋去冬来寒,望君多加裳 待过两月后,你我共相遇 举酒互对...
    刘元璀阅读 215评论 0 0