假设我有以下内容:
enum UserState {
case LoggedIn(LoggedInState)
case LoggedOut(LoggedOutState)
}
enum LoggedInState {
case Playing
case Paused
case Stopped
}
enum LoggedOutState {
case Unregistered
case Registered
}
有没有办法将UserState
保存到UserDefaults
?