What is the architecture officially recommended by Apple for SwiftUI applications?

Hi,
Since SwiftUI came out I have seen it used on almost all architectures like MVC, MVP, MVP + Coordinators, MVVM, MVVM-P, Clean Swift (VIP), Clean Architecture, VISCS, VIPER and Redux.
Those who choose the architecture to use for the future SwiftUI application are often a web tech lead, an Android tech lead, the CTO or even the CEO in some cases. These people often have no knowledge of iOS or macOS and none of SwiftUI.
In other cases, those are former web or Android developers who transpose the architectures they used on the web or on Android onto SwiftUI.
What I would like to know is: What is the architecture officially recommended by Apple for SwiftUI applications?
I'm not talking about a slide between preview during a WWDC session and a small unimportant example program but an official guidelines on an architecture which would be the most suitable, the most "natural" for SwiftUI applications.

2 Likes

Perhaps they don't even recommend any?

I would myself go as far as saying that all of those MVC, MVVM etc. are not necessarily "architectures" since they're all merely concerned with the way one synchronises the UI with some data. SwiftUI already gives you mechanisms for that (Combine) which can be equally applicable in all of those patterns — maybe you could even call it "The Combine Architecture"?

Anyways, you would want to ask Apple. Most people propose that the way the example code behaves is very similar to MVVM, but I also suppose that Apple don't name any particular pattern for a reason.

1 Like

I think the point of architecture is to not be technology dependent.

Your statement on architecture being chosen not by iOS developer/lead doesn't mean that the chosen architecture is not suitable. And even if it's not suitable it should not be discussed in terms of who chose it.

In theory may be in practice no. Some technology works better with certain architectures than others. Trying to use an architecture without taking into account the environment and the underlying technology makes development more difficult and has impacts on the performance and maintainability of applications.

Terms of Service

Privacy Policy

Cookie Policy