Very ImPractical (VIP)Architecture

This is code smell

iceCream.displayedCones = viewModel.cones
iceCream.displayedFlavors = viewModel.flavors
iceCream.displayedToppings = viewModel.toppings

Massive view controller problem

Where is view controller?

Atrocious dog shit design

enum CreateIceCream {
enum LoadIceCream {
struct Request {}

struct Response {
var iceCreamData: IceCream
}

struct ViewModel {
var cones: [String]
var flavors: [String]
var toppings: [String]
}
}
}
let request = CreateIceCream.LoadIceCream.Request()
iceCream.request(load: params)

Welcome to dollar store MVC

It implements view model badly

let viewModel = CreateIceCream.LoadIceCream.ViewModel(
cones: response.iceCreamData.cones,
flavors: response.iceCreamData.flavors,
toppings: response.iceCreamData.toppings
)
view?.displayIceCream(viewModel: viewModel)
iceCream.displayedCones = viewModel.cones
iceCream.displayedFlavors = viewModel.flavors
iceCream.displayedToppings = viewModel.toppings
view?.displayIceCream(response)

Presenter is redundant

As an exercise, guess why you don’t need presenter before you read on.

How not to do POP

protocol CreateIceCreamPresentationLogic {
func presentIceCream(response: CreateIceCream.LoadIceCream.Response)
}

class CreateIceCreamPresenter {
var view: CreateIceCreamDisplayLogic?
}

Wrap Up

There are tons of other shit that I can write about. But I got to eat now.

Edit

Forgot to write about Router. This is top entertainment and it would be a shame to miss out.

struct Model: View {}
struct MyView: View {}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store