-2

In iOS generally we follow MVC project structure but it makes our view controller very massive.

I seen many Github projects but there is no such example which makes my view controller small, modular code, reusable code and many more things.

Generally what i am doing is something like this... Image of architecture

  • Service layer handles the logic whether they want to save the data in CoreData or not and also provides proper parameters for network layer to make api call..
  • Network Layer calls the api with or without header or token according to requirement and then get the response and then parse the data and provide the temp model to service layer.

But still i am unable to find the best way to create architecture for iOS project. It would be really helpful if someone will provide me any link or provide us any github link of their code.

  • @colidyre thanks for pointing out... i will write the same over there... – ROCKING-XCode Oct 07 '15 at 10:01
  • 2
    @colidyre - Please _do not_ recommend other sites unless you are familiar with their quality guidelines. This question is too broad for Programmers. –  Oct 07 '15 at 13:38
  • I do not completely agree. The OP presented a image describing a software architecture. This is imo a good point to give answers there. But sure, one can definitively have another opinion. But at the end this topic definitively belongs more to Programmers than to SO. The OP can ask the question there __and__ can edit the question there to be more specific, if needed. – colidyre Oct 07 '15 at 14:06
  • 2
    @colidyre - As one of the [most active close voters](http://programmers.stackexchange.com/review/close/stats) on Programmers, I assure you that this question is not a good fit there. And if you look at the [cross-post](http://programmers.stackexchange.com/q/299226/53019), you'll see it's been downvoted and currently has 3 VTCs. Architectural questions belong on Programmers, yes. But this question is too broad. Please also see: http://meta.programmers.stackexchange.com/questions/7182/what-goes-on-programmers-se-a-guide-for-stack-overflow –  Oct 07 '15 at 14:11
  • Ok. To clarify: I'm very sorry for the downvotes of OP. But I've never said it would be a good idea to copy/paste and to crosspost the question as it is. But not to expand this to a discussion: Next time I will check if question, especially from a new user, would also fit into guidelines of suggested site. Promise. Thx for the hint. – colidyre Oct 07 '15 at 14:23

2 Answers2

1

You can look to MVVM pattern. Some example is here

kirander
  • 2,202
  • 20
  • 18
0

I've written a quick introduction to MVVM. It explains briefly what MVVM is and why you should use it over MVC. Here's a more detailed look at MVVM.

If you need more granulation, you can use VIPER.

In my opinion MVVM is great for small/medium projects and VIPER should be considered in huge projects with a lot of contributors.

You need some language mechanic for binding in MVVM. KVO does the job, but it's API isn't very good. You could try ReactiveCocoa for data binding in MVVM/VIPER.

michal.ciurus
  • 3,616
  • 17
  • 32