STOP using MVVM for SwiftUI | Clean iOS Architecture

preview_player
Показать описание
STOP using MVVM for SwiftUI | Clean iOS Architecture

Want to build an app with Design Patterns for iOS and clean architecture? Want to learn design patterns ios? Are you looking for a good swift ui tutorial and clean code video? Have you ever wondered how to clean architecture in ios works? Well you're in luck! Because in this swift design patterns video we will core all of that! ​In this ios architecture patterns video you will discover adapter design pattern, decorator design pattern, observer design pattern and swift architecture patterns in general. I will give some tips on functional reactive programming, ios design pattern, ios engineering, clean architecture use cases and much more! In this apple design patterns video I'll guide you through clean architecture example, swift reactive programming and ios patterns. In this advanced swift video we will talk about clean code github, design patterns code, learning design patterns and ios design patterns swift. ​Don’t forget to subscribe to my YouTube channel for more Design Patterns for iOS and swiftui tutorials.
Rebeloper is here to help you in learning Design Patterns for iOS.
Let's dive in!

Don’t forget to download the resources:

***VIDEOS I RECOMMEND***

→ PLAYLIST:
SwiftUI Secrets:

DO YOU WANT TO BE MY APPRENTICE?

TOOLS I RECOMMEND:
__________
Say hi on social:

Get in touch:

SUBSCRIBE to weekly tips & tutorials for building iOS apps!

____

#rebeloper

CHAPTERS:
_____
00:00 INTRO
00:18 WHY MVVM
01:28 IVO BASICS
04:15 IVO EXAMPLE
04:33 IDENTIFIABLE
08:37 OBSERVED
11:18 VIEW CONNECTIONS
16:35 DEMO
17:57 WHAT TO DO NEXT
Рекомендации по теме
Комментарии
Автор

What is your favourite Design Pattern in SwiftUI?

rebeloper
Автор

Besides the naming and nesting one type into another, how exactly this pattern differs from a regular mvvm?

alexeylobankov
Автор

There is no difference from MVVM and what you've described here apart from just putting a different label/name and made such a big claim to "STOP using MVVM". Was expecting at least some challenging arguments and new solutions exclusive for SwiftUI. We us this in our projects.

Jonauz
Автор

So just Model, View, ViewModel EXCEPT we call it Identifiable, View, Observed. GENIUS.

jlambert
Автор

This is basically MVVM but the Model has to be identifiable and the view model is inside the View

pawelpow
Автор

He’s just creating flat scopes that will inevitably cause massive memory and scoping issues for redrawing once you have to add more than a single screen to your test app. Would not recommend doing anything similar to this. There’s really no pattern here, and the way he’s managing the view model makes me think he doesn’t even understand why you’d want a view model in the first place or how you’d write tests to cover this monstrosity

imfractured
Автор

If you return something that is unstable, like UUID() or an index, this means you get a new object each time you get the object and this will kill reusability and can cause epic memory and layout process usage beside view management issues like transition management and etc.

Antonnel
Автор

Why did you use an optional value instead of a default parameter value?

bobweiram
Автор

How would you share an observed object between several views?

federicotorres
Автор

can you do a video about TCA architecture>?

nat.serrano
Автор

Why I like the concept for it simplicity it may end up creating difficulty for a medium or large project. The layers are tightly coupled so maintaining the code will become a big issues quickly. I always advocate for separating business logic from every other layer/part of your code and business layer should never depend on any concrete implementation of any other part of your code.

paulikhane
Автор

which Xcode theme you are using, it looks decent and clean.

ScaleCodingSkills
Автор

Just curious: with this approach, how do you handle the case where one observed resource needs to be shared and observed by multiple views ?

jonathansack
Автор

What about when using concurrency (async/await)? How does that work with IVO?

manueldefreitas
Автор

Very interesting. Just wondering how this would simplify getting automatic coredata database updates that @FetchRequest offers
Thanks

fulviofagnani
Автор

No offense but i feel like put functions in the views kind of messy to me, I prefer mvvm I’d say

charles-es
Автор

This doesn't changes anything to MVVM, is the same pattern with different naming conventions. 

Observable could just be @State, and profile doesn't need to conform to Identifiable if you're not going to use that conformances for something, like display the fetched entities in it in a list, which is not the case since your fetch fetches a single profile.

cristianf
Автор

Hello, thanks for the explanation, I applied it in a demo that I am making to practice SwiftUI, but I have a doubt,
Could you give me an example of where I should declare an EnviromentObject? would it be inside the View or inside the Observed class?

mrx
Автор

how about the memory cycle in Observed's completion ?)

MrMassmaker
Автор

the init func is really a bad practice,
why not give Date() instead of nil as the default value

aelamw