mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-04-27 11:07:11 +02:00
Add Time Travel
This commit is contained in:
11
Examples/TimeTravel/SwiftUITimeTravel/TimeTravelView/StateMachine.swift
Executable file
11
Examples/TimeTravel/SwiftUITimeTravel/TimeTravelView/StateMachine.swift
Executable file
@@ -0,0 +1,11 @@
|
||||
/// Conforming types serve as the state of a time travelable application
|
||||
public protocol StateMachine {
|
||||
|
||||
/// Events define things that can happen within your application that change its state.
|
||||
///
|
||||
/// This might include things like text editing, button taps, or network responses.
|
||||
associatedtype Event
|
||||
|
||||
/// Applies an event to the current state.
|
||||
mutating func update(with event: Event)
|
||||
}
|
||||
Reference in New Issue
Block a user