Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no correct answer for this question. It depends on taste. I mitigate for readability. Don't be shy to give a long name for your segue identifier; give long and expressive names because Objective-C is a very verbose language leveraging us to write very readable code.</p> <p>I have searched for an official convention, but I couldn't find any. Here's what Apple has to say:</p> <blockquote> <p>You assign identifiers to your segues in Interface Builder. An identifier is a string that your application uses to distinguish one segue from another. For example, if you have a source view controller that can segue to two or more different destination view controllers, you would assign different identifiers to each segue so that the source view controller’s prepareForSegue:sender: method could tell them apart and prepare each segue appropriately.</p> </blockquote> <p>Another quote from <a href="http://www.raywenderlich.com/5191">Ray Wenderlich's site</a>:</p> <blockquote> <p>Give the segue a unique Identifier. (It only has to be unique in the source scene; different scenes can use the same identifier.)</p> </blockquote> <p>An interesting approach for picking the identifier name (see above link for more):</p> <ol> <li><p>First write the code that verifies for the segue identifier name BEFORE you even set the name in the interface builder. I'm talking about this code: <code>if ([segue.identifier isEqualToString:@"SegueIdentifierName"])</code></p></li> <li><p>Build &amp; Run! Don't fill in the identifier name in the Interface Builder yet. You do this because you may have multiple outgoing segues from one view controller and you’ll need to be able to distinguish between them. If nothing happens while you run and trigger the segue you're working on, then your segue name identifier is unique and good to be used. If instead the code performs a segue that you haven't intended, you have a conflict for the sague name identifier.</p></li> <li><p>Fix the conflict - if any.</p></li> <li><p>Fill in the segue identifier in the Interface Builder and test that it does what you want.</p></li> </ol> <p>I like this because it's like a TDD approach: write a failing test, write some code to pass the failing test, refactor, repeat.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload