๐Ÿ”ธ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