I came from C# development and even though I've been spending the past few months looking into iOS development and know enough to keep me busy for a while, all I've ever seen is people putting code directly into the ViewController leading to a fat controller. My coding experience has led me to break everything out into separate files and have helper classes to hold commonly used methods and running most of the heavy lifting code (such as creating a deck of cards or grabbing user input and performing complex calculations).
I was taught that methods should not have any more than 6 lines of code in them, classes should not be larger than the height of your screen, and of course repeated code should be a method. Now classes I've created I have no problems with generally keeping it on the height of my screen, but the GameScene class or ViewController class end up being pretty large, and Apple tends to place a lot of code directly in these such as didMoveToView and viewDidLoad in their templates.
I'm just curious if there was a best practice for all of this. Yes I understand the MVC structure, but the structure seems to be night and day between ASP.NET and Swift. Is this contributed to performance issues with multiple helper classes and the LLVM compiler?
I was taught that methods should not have any more than 6 lines of code in them, classes should not be larger than the height of your screen, and of course repeated code should be a method. Now classes I've created I have no problems with generally keeping it on the height of my screen, but the GameScene class or ViewController class end up being pretty large, and Apple tends to place a lot of code directly in these such as didMoveToView and viewDidLoad in their templates.
I'm just curious if there was a best practice for all of this. Yes I understand the MVC structure, but the structure seems to be night and day between ASP.NET and Swift. Is this contributed to performance issues with multiple helper classes and the LLVM compiler?