ios 如何在 xcode 的故事板上设置场景名称

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25164873/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 01:44:22  来源:igfitidea点击:

How to set scene name on xcode's storyboard

iosxcodecoffeescriptzucchini

提问by André Muniz

I am using the CoreDataBooks sample project from Apple to use with the Zucchini automated test framework. I need the view name to use in the coffeescript to manage it like this:

我正在使用 Apple 的 CoreDataBooks 示例项目与 Zucchini 自动化测试框架一起使用。我需要在咖啡脚本中使用的视图名称来像这样管理它:

class BooksScreen extends Screen anchor: -> $("navigationBar[name=Authors]")

class BooksScreen extends Screen anchor: -> $("navigationBar[name=Authors]")

In this example, the Authors is used to identify the view. I figured in xcode that we have this name after view controller class of each scene, like the New Book scene:

在此示例中,作者用于标识视图。我想在 xcode 中,我们在每个场景的视图控制器类之后都有这个名字,比如 New Book 场景:

enter image description here

在此处输入图片说明

The problem is, I don't know how to set that name, so I can manage it in the coffeescript. How to do this?

问题是,我不知道如何设置该名称,因此我可以在 coffeescript 中对其进行管理。这该怎么做?

回答by vignesh

You have set the name for view controller in Interface Builder.

您已经在 Interface Builder 中设置了视图控制器的名称。

  1. Select view controller
  2. Now from menu View->Utilities->Show attributes inspectors
  3. Set view controller title.
  1. 选择视图控制器
  2. 现在从菜单视图->实用程序->显示属性检查器
  3. 设置视图控制器标题。

回答by Cattla

do it in Xcode right column like following image, enter new scene name and press enterbutton.

在 Xcode 右栏中执行此操作,如下图所示,输入新场景名称并按下enter按钮。

enter image description here

在此处输入图片说明

回答by Marina

You have to click on the name of the view controller and wait. Click very slowly, you have to click and hold for some time. Do not click twice, you only need to click once but it has to be a long click.

您必须单击视图控制器的名称并等待。单击非常缓慢,您必须单击并按住一段时间。不要单击两次,您只需单击一次,但必须是长按。

回答by Howard Lovatt

In the left hand list double click on the name of the view controller, not the scene name, and rename the view controller, that will also rename the scene.

在左侧列表中双击视图控制器的名称,而不是场景名称,并重命名视图控制器,这也将重命名场景。

enter image description here

在此处输入图片说明