UI基础整理-15


storyboard传值

//

//  Mysegue.h

//  Lesson15_storyBoard

//

//  Created by Floating_SH on 15/12/7.

//  Copyright © 2015 SH. All rights reserved.

//


#import


@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;

}



UI基础整理-15_第1张图片


//写动画时用的

// 在进行页面跳转的时候 , 会自动执行此方法 , 如果我们使用自定义 segue, 那么意味着我们必须重写此方法来完成页面跳转效果的书写
-
(
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(@"切换完成后的操作...."
);
       
    }];
   
  
xib和storyboard  
xib更适合团队开发


control+左键 快速加约束


定义model对象时必须写的两个方法
      - ( NSString *)descrption{
   
   
return [ NSString stringWithFormat : @"%@" , _name ];
}

- (
void )setValue:( id )value forUndefinedKey:( NSString *)key{
   
   
NSLog ( @"===========%@" ,key);
}




你可能感兴趣的:(UI基础整理)