26.5 Using App Storage
The final task in this tutorial is to demonstrate the use of app storage. Within Xcode, edit the AppStorageView.swift file and modify it so that it reads as follows:
import SwiftUI
struct AppStorageView: View {
@AppStorage("mytext") var editorText: String = "Sample Text"
var body: some View {
TextEditor(text: $editorText)
.padding(30)
.font(.largeTitle)
}
}
.
.
With the changes made, run the app on the iPad once again and repeat the steps to display two scene instances side-by-side. Select the App Storage tab within both scenes and note that the scene instances are displaying the default sample text...