自定义segue

来源:互联网 发布:数控机床模拟软件 编辑:程序博客网 时间:2024/06/11 01:36
自定义segue
继承UIStoryboardSegue这个类,并重写这个类中的- (void) perform方法

例:
#import <UIKit/UIKit.h>@interface XYJPushWithoutAmimation : UIStoryboardSegue@end



实现:

#import "XYJPushWithoutAmimation.h"@implementation XYJPushWithoutAmimation- (void)perform{    UIViewController *source = self.sourceViewController;    UIViewController *destination = self.destinationViewController;    [source.navigationController pushViewController:destination animated:NO];}@end

写好上面的自定义segue类后,只需要在storyboard中使用custom的segue上写上该类即可
0 0
原创粉丝点击