Slide 68
Slide 68 text
αϯϓϧίʔυʢϩάΠϯॲཧʣ
// 1. switch-caseΛͬͨύλʔϯϚονϯά
let mapping: NextMapping = { fromState, input in
switch (fromState, input) {
case (.LoggedOut, .Login):
return (.LoggingIn, loginOKProducer)
case (.LoggingIn, .LoginOK):
return (.LoggedIn, .empty)
case (.LoggedIn, .Logout):
return (.LoggingOut, logoutOKProducer)
case (.LoggingOut, .LogoutOK):
return (.LoggedOut, .empty)
case (.LoggingIn, .ForceLogout), (.LoggedIn, .ForceLogout):
return (.LoggingOut, forceLogoutOKProducer)
default:
return nil
}
}