storyboard传值
//
// Mysegue.h
// Lesson15_storyBoard
//
// Created by Floating_SH on 15/12/7.
// Copyright © 2015年 SH. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface Mysegue :UIStoryboardSegue
@end
//
// Mysegue.m
// Lesson15_storyBoard
//
// Created by Floating_SH on 15/12/7.
// Copyright © 2015年 SH. All rights reserved.
//
#import "Mysegue.h"
@implementation Mysegue
//在进行页面跳转的时候,会自动执行此方法,如果我们使用自定义segue,那么意味着我们必须重写此方法来完成页面跳转效果的书写
- (void)perform{
//三个属性
//self.identifier //标识符
//self.destinationViewController //目的控制器
//self.sourceViewController //源控制器
//源控制器根视图
UIView *sourceView =self.sourceViewController.view;
//目标控制器根视图
UIView *destinationView =self.destinationViewController.view;
//设置页面翻转
//第一个参数:动画起始视图
//第二个参数:动画结束视图
//第三个参数:动画持续时间
//第四个参数:动画效果枚举值
//block: 书写在里面的代码在动画结束后执行
[UIViewtransitionFromView:sourceViewtoView:destinationViewduration:3options:UIViewAnimationOptionTransitionCurlUpcompletion:^(BOOL finished) {
NSLog(@"切换完成后的操作....");
}];
}
@end
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//storyboard不需要注册cell xib需要注册cell
MyCell *cell = [tableViewdequeueReusableCellWithIdentifier:@"myIdentifier"forIndexPath:indexPath];
return cell;
}
- (void)perform{
//三个属性
//self.identifier //标识符
//self.destinationViewController //目的控制器
//self.sourceViewController //源控制器
//源控制器根视图
UIView *sourceView = self.sourceViewController.view;
//目标控制器根视图
UIView *destinationView = self.destinationViewController.view;
//设置页面翻转
//第一个参数:动画起始视图
//第二个参数:动画结束视图
//第三个参数:动画持续时间
//第四个参数:动画效果枚举值
//block: 书写在里面的代码在动画结束后执行
[UIViewtransitionFromView:sourceViewtoView:destinationViewduration:3options:UIViewAnimationOptionTransitionFlipFromRightcompletion:^(BOOLfinished) {
NSLog(@"切换完成后的操作....");
}];
return [NSString stringWithFormat:@"%@",_name];
}
- (void)setValue:(id)value forUndefinedKey:(NSString*)key{
NSLog(@"===========%@",key);
本文介绍如何在iOS应用中创建自定义的Storyboard Segue,并实现页面间的翻转动画效果。通过重写`perform`方法,利用UIView动画方法完成从源视图到目标视图的过渡。

被折叠的 条评论
为什么被折叠?



