简体   繁体   English

在Anypic中使用WelcomeViewController的目的是什么(ios,Parse)

[英]What is the purpose of having WelcomeViewController in Anypic(ios,Parse)

I wonder what is the purpose of having a WelcomeViewController in Anypic since their is no WelcomeView associated with it. 我想知道在Anypic中使用WelcomeViewController的目的是什么,因为它们没有与之关联的WelcomeView。 It checks if currentUser exists, if no then LoginViewController is presented, if yes then proceed to TabBarController. 它检查currentUser是否存在,如果不存在则显示LoginViewController,如果是,则继续执行TabBarController。 Why not putting the logic in WelcomeViewController to AppDelegate, or just create an empty ViewController as what is done is AnyWall app? 为什么不将WelcomeViewController中的逻辑放到AppDelegate中,或者只是创建一个空的ViewController,就像AnyWall应用程序一样? Thank you Zach 谢谢扎克

By following the code in GitHub, the best answer i can give you is that they do this to get order in their application design. 通过遵循GitHub中的代码,我能给你的最佳答案是他们这样做是为了在他们的应用程序设计中获得订单。 If like you said they placed all the code into the app delegate, then the AppDelegate will be messy and un-ordered (you can see that WelcomeView has a lot of functionality code). 如果您说他们将所有代码放入app委托,那么AppDelegate将是凌乱和无序的(您可以看到WelcomeView有很多功能代码)。

There is no right and wrong, if the code works then the code works. 没有对错,如果代码有效则代码可以工作。 But if your code if built in a good design, you will have a lot less work if you wish to alter something in the future. 但是如果你的代码是用一个好的设计构建的,那么如果你想在将来改变某些东西,那么你的工作就会少得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM