Suddenly, you have more than 3,000 lines of code.
Dealing with Spaghetti Code
Apple bases its UI abstraction inside
the since it is at the core of the iOS UI code and part of the design pattern. ,
Upgrading the MVC Design Pattern
Easy to see that this could lead to View and Controller code paths getting crossed.
MVVM to the Rescue
Now, the (
UIView) has become much simpler while acts as the glue between the and .
Applying MVVM in Swift
First, I suggest you download the Starter
project, and follow this tutorial. If you need a quick reference of the project for later, download the Finished project.
Tutorial Project Introduction
The tutorial project is a basketball application for the tracking of player actions during the game.
Project hierarchy looks like this:
This blog is listed under Development & Implementations Community
Share your perspective
Share your achievement or new finding or bring a new tech idea to life. Your IT community is waiting!