Keep UI Out of Shared Code
Draw the line so the shared layer stays portable.
Draw a Clear Line
Shared code holds logic; the UI stays native. Drawing this line early keeps your common module portable to every target.
Why UI Does Not Belong
Android views and SwiftUI are platform-specific. Putting them in commonMain would break compilation on the other target instantly.
All lessons in this course
- A Shared Price & Tax Calculator
- Format Currency & Numbers
- Business Rules as Pure Functions
- Keep UI Out of Shared Code