Avatar
import SwiftUI import Observation struct FooView: View { @State var state: FooViewState = .init() var body: some View { VStack { // ... } .task { state.bar() await state.load() } } } @Observable final class FooViewState { var value: Int = 0 func bar() { } @execution(caller) func load() async { // valueをロード } }