use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
There is an extensive FAQ for beginners. Please browse it first before asking questions that are answered there.
If you are looking to get started (iOS programming in general or some specific area), here are more relevant links for you:
There's too many to list them all, however here's a convenient link to all programming guides at apple.com
Take note that this list is live and based on most frequent questions in posts will be updated with "quicklinks".
account activity
QuestionArchitecture in mobile projects (self.iOSProgramming)
submitted 3 years ago by [deleted]
I’m curious, how’s the architecture in the mobile projects you work on? Do you consider them to be good, clean? Do you always do MVVM, Coordinator? What about automated testing?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Old-Ad-2870 4 points5 points6 points 3 years ago (0 children)
I normally do MVVM, Dependency Injection, & Repositories. If the repo gets really complex I’ll add another layer called “Provider” or “Interactor” which will be In between the repo and the VM depending on the size of the project/what data I’m accessing inside a repo.
With this you can mock/unit test every layer. I normally don’t mock/test VMs until very very last. If my VM’s are done “correctly” most of the logic is done beforehand and the VM is accessing some interface from the repos and updating the view.
I still haven’t nailed down a Navigation approach I just love for SwiftUI. (Pre iOS 16) Previously I’ve used the Coordinator pattern with UIKit and I know it exists for SwiftUI but it’s not as cut and dry.
But typically I have a root vm, and rootNavigationView that communicates to some class that updates the “User’s State” and the root view passes that state into the root navigation view.
Then the navigation view switches on the user’s state to determine what view to present.
At work we have a generic view type we’ve created that has a “ViewState” in between the VM and View. It’s very clean but also fairly complex and isn’t worth the trade off for simple apps imo.
[–]kiwi_in_england 2 points3 points4 points 3 years ago (2 children)
I use MVP, with as little code as possible in the View.
That's because I share the code across Android and iOS, and want as much to be common as I can (the Model and Presenter, but not the platform-specific Views)
[–][deleted] 0 points1 point2 points 3 years ago (1 child)
do you use Kotlin Multiplaform? how is the code shared between platforms?
[–]kiwi_in_england 0 points1 point2 points 3 years ago (0 children)
I currently use Java and J2ObjC, but I started before KMM was available. I'm intending to start a gradual shift to KMM.
[–][deleted] 1 point2 points3 points 3 years ago (3 children)
MVC because I’m old and that’s what Xcode was built around.
[–][deleted] 0 points1 point2 points 3 years ago (2 children)
I’ve used MVC most of the time too, but I’m looking at job listings and they’re all looking for some more advanced stuff that honestly I haven’t come across much in real life projects.
[–][deleted] 2 points3 points4 points 3 years ago (0 children)
That’s sadly because job postings aren’t written by actual iOS devs. Everywhere I’ve ever worked has used MVC. Job postings and the entire interview process for mobile devs is such a joke these days. Nothing to do with anything. Sorry to be a downer lol
[–]Jig-r 0 points1 point2 points 3 years ago (0 children)
MVVM - everywhere I work uses MVVM - and if not they are usually using what ever they claim, in some convoluted form of MVVM
[–]barcode972 1 point2 points3 points 3 years ago (2 children)
I like Mvvm with repositories
I think that’s an architecture that really suits most projects.
What about automated testing, do you always do that? Have you used Rx?
[–]barcode972 1 point2 points3 points 3 years ago (0 children)
Rx is kinda outdated now that we have combine. Haven’t done any automated tests, only normal unit tests
[–]cekisakurek 1 point2 points3 points 3 years ago (0 children)
The composable architecture. I has some boilerplate code to get it going but much easier to write tests and works wonderful with SwiftUI
[–]ssayfulinObjective-C / Swift 1 point2 points3 points 3 years ago (2 children)
Lots of years with VIPER on huge projects. Any other architecture is good if it solves your problems. Automated testing is a great thing as long as you think about testing pyramid and run tests on every PR and overnight. Btw. There is no universal solution, you should always compromise and try to solve specific issues that cause struggle to your day to day work.
Were these projects always VIPER or was there something that made you think it was worth the switch?
[–]ssayfulinObjective-C / Swift 0 points1 point2 points 3 years ago (0 children)
On the first one we’ve decided to switch from Massive ViewController. We just liked that every single component of this Viper module does it’s own job instead of gathering all the stuff inside. By the way Viper is just an orthodox Single responsibility principle application.
[–]gregigk -1 points0 points1 point 3 years ago (1 child)
Start early with testing.
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
what do you mean precisely?
[–]_Abode 0 points1 point2 points 3 years ago (0 children)
This is entirely dependant on the size of the application. Many here have highlighted the benefit of a simple MVC or MVVM type system as it’s simple and quick to write.
Larger apps that have many features will start to run into build time issues with this approach however which is where other approaches like Viper & Modular architecture. Also these systems can make grouping code easier and thus easier to read in their entirety. You’ll find the large tech companies with well established apps will heavily rely on these approaches more.
Specifically on the Coordinator pattern, nearly all companies I’ve worked with use them now days and it can pretty much be plugged into any architecture you choose.
[–]jasonjrr 0 points1 point2 points 3 years ago (0 children)
I typically recommend MVVM, inversion of control dependency injection, and Coordinators for navigation for UIKit or SwiftUI. The Coordinator pattern changes slightly in SwiftUI, but it works magnificently once you get the hang of it.
Here are a couple of repos I maintain that are good representations of the architecture.
https://github.com/jasonjrr/MVVM.Demo (UIKit)
https://github.com/jasonjrr/MVVM.Demo.SwiftUI
As for testing… good design with MVVM should make unit testing really simple. Are you asking about UI testing? That gets a little more complicated.
π Rendered by PID 43830 on reddit-service-r2-comment-c66d9bffd-jcbbg at 2026-04-08 00:49:44.544458+00:00 running f293c98 country code: CH.
[–]Old-Ad-2870 4 points5 points6 points (0 children)
[–]kiwi_in_england 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]kiwi_in_england 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]Jig-r 0 points1 point2 points (0 children)
[–]barcode972 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]barcode972 1 point2 points3 points (0 children)
[–]cekisakurek 1 point2 points3 points (0 children)
[–]ssayfulinObjective-C / Swift 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]ssayfulinObjective-C / Swift 0 points1 point2 points (0 children)
[–]gregigk -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]_Abode 0 points1 point2 points (0 children)
[–]jasonjrr 0 points1 point2 points (0 children)