Storyboard & Segue - Passing datas am i doing it good?

荒凉一梦 提交于 2019-12-06 13:43:18

Your first example is fine. You aren't creating anything, just getting a reference to your destination controller. Setting up a variable like that allows you to set multiple properties on the destination view controller without having to cast over and over again.

So, to answer your specific questions:

  • yes, that's the best way. It's difficult to get prepareForSegue "beautiful" because of the generic class of destination view controller
  • no, you're not creating anything.
  • no, you don't have anything to clean up.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!