Clean-Swift / CleanStore

A sample iOS app built using the Clean Swift architecture. Clean Swift is Uncle Bob's Clean Architecture applied to iOS and Mac projects. CleanStore demonstrates Clean Swift by implementing the create order use case described by in Uncle Bob's talks.
https://clean-swift.com/clean-swift-ios-architecture/
MIT License
1.91k stars 315 forks source link

Convert view models from structs to tuples #24

Closed basememara closed 1 year ago

basememara commented 6 years ago

In an effort to make view models almost as dumb as enums, how about using tuples over structs?

Benefits I see:

  1. Disallow func, init, and other logic
  2. Get equatable for free (https://github.com/apple/swift-evolution/blob/master/proposals/0015-tuple-comparison-operators.md)
  3. Access members by index?

Can you think of any issues or implications of this (performance, memory, etc)?

Further discussions: https://stackoverflow.com/questions/27384151/swift-tuples-different-from-struct-and-from-each-other