zoukankan      html  css  js  c++  java
  • ##DAY14——StoryBoard

    •iOS下可视化编程分为两种⽅式:xib和storyboard。

    •在使用xib和storyboard创建GUI过程中,以XML文件格式 存储在Xcode中,编译时生成nib的二进制文件。在运行时, nib⽂件被加载并且开始创建和实例化GUI元素。

    //当stroyboard通过页面跳转时,此方法就会执行
    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
        //segue有三个非常重要的属性
        /*
         1、identifier,标识符,标识区份线(segue),可以选择性的跳转
         2、sourceViewController,源视图控制器
         3、destinationViewController,目标视图控制器
         */
        if([segue.identifier isEqualToString:@"secondVC"]){
            SecondViewController *secondVC = segue.destinationViewController;
            secondVC.string = self.usernameTF.text;
            
        }
    }
    - (IBAction)regist:(id)sender {
        //每一个视图控制器都有一个属性叫storyboard,可以找到当前视图控制器交由哪个故事板管理。并且故事板可以通过storyboardID来找到加到其内部的视图控制器
    //    UIViewController *controller =
    //    [self.storyboard instantiateViewControllerWithIdentifier:@"second"];
    
    //    [self presentViewController:controller animated:YES completion:nil];
        
        [self performSegueWithIdentifier:@"secondVC" sender:nil];
    }
  • 相关阅读:
    剑指63.数据流中的中位数
    剑指62.二叉搜索树的第k个结点
    JPA ---- EntityManager使用
    JPA ---- EntityManager介绍
    win10多桌面切换
    $emit子组件如何传递多个参数
    height高度自适应
    vue Avoided redundant navigation to current location
    Ant Design 使用小结
    Object.keys方法之详解
  • 原文地址:https://www.cnblogs.com/chongyu/p/5209447.html
Copyright © 2011-2022 走看看