Set of Swift classes for building and operating a state machine