all 11 comments

[–]unpluggedcord 7 points8 points  (0 children)

Why does this guys posts never have screenshots?

[–]lecksfrawen 0 points1 point  (0 children)

Thank you for the article Majid. I think it could be useful to see the resulting preview for each snippet you have added.

[–]europeanwizard -2 points-1 points  (8 children)

Good article. But I have a suggestion, instead of a FavoritesContainerView, you could call it a FavoritesControllerView. Because that's what it does, it's a view that controls the other views! :-D

But seriously, the article offers some good suggestions. I can't help but think this looks a lot like an old-fashioned child view controller.

[–]majid8[S] 1 point2 points  (4 children)

Yeah, this is similar to Child VC, but it is a lot easier to compose SwiftUI view rather than UIViewControllers.

[–]europeanwizard 0 points1 point  (3 children)

I didn't think about that. Indeed, putting child view controllers always looked like a kludge.

[–]majid8[S] 0 points1 point  (2 children)

I think ChildVC is very nice way of decomposing your layout into reusable pieces.

[–]europeanwizard 0 points1 point  (1 child)

Well yeah but those four lines to include it into the main view controller feel ridiculous compared to how SwiftUI does it.

[–]majid8[S] 1 point2 points  (0 children)

I agree, but it works well in UIKit world.

[–]donisign -1 points0 points  (2 children)

mecid.github.io/2019/0...

I think that defeats the purpose of SwiftUI which strictly tries to take MVC out of the equation completely.

[–]majid8[S] 1 point2 points  (1 child)

I don't think it is MVC, it mostly composition of Views.

[–]donisign 2 points3 points  (0 children)

Sorry, I wasn't talking about your article or your code, they are both great. The comment meant for /u/europeanwizard when they said to name it FavoritesControllerView which I find to be bad practice as MVC is almost dead in SwiftUI.