30

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:

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:

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?

André Muniz
  • 708
  • 2
  • 8
  • 17

5 Answers5

49

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

  1. Select view controller
  2. Now from menu View->Utilities->Show attributes inspectors
  3. Set view controller title.
Prabhakar Kasi
  • 531
  • 4
  • 18
vignesh
  • 994
  • 10
  • 12
  • in addition, incase still it isn't shown, add Navigation Bar to ViewController: 1. Show attributes->Simulated Metrics->Top Bar 2. Set "Translucent Navigation Bar" or "Opaque Navigation Bar" – Fatih Aksu May 16 '18 at 07:39
13

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

enter image description here

Alien
  • 3,658
  • 1
  • 16
  • 33
2

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

Howard Lovatt
  • 968
  • 1
  • 8
  • 15
1

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.

Marina
  • 49
  • 1
  • 8
0

If you rename the navigation item it will rename the scene as well. Select the navigation item for the scene you want to rename in the Object Browser on the left, then go to the Attributes inspector on the right and change the Title to the name you want. It will automatically rename the navigation item and the scene.

See screenshot:

Rename Scene by Renaming Navigation Item

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129