🔸data separation
terms ⟩ data separation
The concept that an app's data model should be defined separately from the user interface used to display and interact with that data.
Data separation allows you to modify the data model and UI independently of each other, makes it easier to understand how your app works, and improves the testability of your app.
Examples
import SwiftUI
struct ContentView: View {
// ⭐️ view state (data)
@State var isOn = true
// ⭐️ user interface
var body: some View {
// ...
}
}
Last updated
Was this helpful?