iOS 7 XCode 5故事板布局示例 [英] iOS 7 XCode 5 Storyboard Layout Example

查看:203
本文介绍了iOS 7 XCode 5故事板布局示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个死的简单故事板应用程序,其布局类似于以下内容。我有列表/详细信息视图设置但我无法弄清楚如何链接其他页面。我希望将go页面作为我的起始页面,并将其驱逐出去。

I'm trying to create a dead simple storyboard app with a layout similar to the following. I've got the list/detail view setup but I can't figure out how to link additional pages. I want the "go" page to be my start page and drive off that.

有人可以通过一个简单的示例解决方案来帮助我如何设置它吗?我正在尝试使用推段。

Can someone help me with a dead simple example solution on how you would set this up? I'm trying to use "push" segues.

推荐答案

以下是创建segues的不同方法:

Here are different ways to create a segues:

1 - 从控制到控制器:

2 - 使用连接检查器

3 - 从View Controller到View Controller

< img src =https://i.imgur.com/zwMIIpC.gifalt =从View Controller到View Controlle!>


  • #1 #3 您需要在
    之前持有 control 拖动。

  • #2 & #3
    您需要为您的segue提供一个标识符,与#1 不同,您必须使用代码执行segue:

  • #1 and #3 you will need to hold control before dragging.
  • #2 & #3 : You will need to give an identifier to your segue, unlike #1 You have to performe the segue using code:

添加标识符:

执行segue:

[self performSegueWithIdentifier:@"yourSegue" sender:sender];

现在就是这件事,如果您需要传递一些数据,这将只执行segue到那个视图控制器。然后你必须实现以下segue deleguate:

Now here is the thing, this will just perform the segue, if you ever needed to pass some data to that view controller. Then you have to implement the following segue deleguate:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Make sure your segue name in storyboard is the same as this line
    if ([[segue identifier] isEqualToString:@"yourSegue"])
    {
        //if you need to pass data to the next controller do it here
    }
}

这篇关于iOS 7 XCode 5故事板布局示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆