Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Andrei Durnea

macrumors newbie
Original poster
Aug 9, 2018
1
0
I know everybody implements the design pattern they see fit for their problem but it seems to me that in the past, apple's guideline was towards MVC.

Maybe this will change with the next Xcode.

In the image attached, the folder structure visible seems to have a folder/group named View Model Classes.

Hello MVVM!

The image was here https://developer.apple.com/ on 9/Aug/18
 

Attachments

  • Screen Shot 2018-08-09 at 14.36.37.png
    Screen Shot 2018-08-09 at 14.36.37.png
    1.2 MB · Views: 299
Last edited:
MVVM is the next big thing. Problem is that if you read any articles about MVVM on iOS they all start out with the same diagram but they all end up with different implementations. Some of the basics of MVVM can address the problem of 'massive view controller' on iOS by moving certain parts of code that commonly goes into view controllers into a second class. I do that in my current projects. However there's a part of MVVM called 'data binding' that has no simple clear obvious way to be implemented on iOS. There are various ways to do it but none that use simple built-in methods AFAIK.

I doubt that Apple will deprecate MVC. UIKit is built around it. However they might provide example code that shows how they think MVVM should be done on iOS. There is strong support for data binding on macOS including classes and IB support for making connections between objects, although I haven't kept up with Mac development for a while. Maybe they could bring that support over to iOS or maybe provide a more swifty way to do data binding.
 
It depends on what kind of project you are working on. For small project, MVC is still the best bet IMO
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.