I know this question can be considered "too broad", but if some of the experts can give me an idea or guide on this issue, then it will be very useful to decide which design paradigms I should use?
I created several projects in OOP , as I look and go through POP , I realized that we can achieve what a class can do by replacing it with a combination of Structure and protocol.
And when I watch a video of WWDC events, they quote, “Don't start with class, start with protocol,” I also look at examples and tutorials
But it is not yet clear when to use a Struct or class. Somehow we need to use Class.
To clarify the question,
Consider an example application: in which I have to call a web service, get data, convert them to models, bind them in the user interface. The main simplest application that we have developed in iOS. So why what approach should be used?
To clear my understanding, I also look at the source code for open source applications, but in most cases they used classes.
So, in what cases should we use ** Classes instead of Structure and Protocol. ? **
, POP .
, - .
( ) Struct Swift.
, , - .
, , , . .