Can we use SwiftUI, with MVVM

Solved!

Says it all in the title, only been able to find stuff with MVVM in UIKit, but I’d prefer SwiftUI

So sorry if it’s a stupid noobish question, but just wondering if we are bound to UIKit

Thanks for any help that’s provided :)

Posted Dec 24, 2021, 8:05 PM UTC

512
Zer0-mb•

Yes, you can, check combine

7
ActuallyInnoOP•

Thanks for the quick answer mate, appreciated

2
[deleted]•

[deleted]

1
[deleted]•

[deleted]

4
Niha_d•

There’s plenty of videos in YouTube for SwiftUI MVVM search

2
Rillieux17•

Yeah, I use it (try to use it)

Here's a repo SwiftUI+MVVM+CoreData project you can look at:

https://github.com/Rillieux/Contacts

I'm uncertain if this is the best way to go, but so far it seems to work.

And here is more or less the same thing, but stripped down almost as far as possible:

https://github.com/Rillieux/Fish

2
ace_in_the_hole69•

As a stupid noob myself, I can confirm MVVM has been the main way I’ve been making apps on SwiftUI so far

1
kayjayapps•

Stanford uploaded their entire spring 2021 semester SwiftUI with MVVM course on YouTube. It’s a very good course IMO. https://youtu.be/bqu6BquVi2M

1
barcode972•

Sure though some people think it's more similar to mvc but I think you can?

0
ActuallyInnoOP•

Thanks for the quick andwer, guessing mvc is similar to mvvm but different kinda architecture

1
barcode972•

I actually don’t really know myself. I think I’m doing Mvvm but maybe it is mvc 😂

3
ActuallyInnoOP•

from the videos I’ve watched on YouTube, mvvm seems to be quite straightforward and good to use

1
Fluffy_Risk9955•

Don’t use MVVM. Apples frameworks are not designed with MVVM in mind. Implementing MVVM will bring unnecessary work to the table taking time you could spent on building features.

0
-14k-•

lol

0