Storyboard Segue Identifier naming conventions

前端 未结 4 374
情书的邮戳
情书的邮戳 2021-01-31 14:46

I\'m building a large storyboard and I was wondering if anyone has come up with helpful naming conventions for segue identifiers.

It looks like Apple j

4条回答
  •  醉酒成梦
    2021-01-31 15:25

    Personally I would not use the animation-type in front, if you change the animation, you'll need to go back to the code. However, if you declare the segue identifier as a constant in the source controller, you can more easily change the name at a later stage, without digging through the code.

    I generally use the name I gave the controller, without the "ViewController". So RatingViewController would be "Rating" as storyboard. One exception are the unwind segues, I name those starting with "returnTo" ending in the name of the destination ("returnToRating").

提交回复
热议问题