The new Finite offers you two new features: temporarily subscribing transitions and observing any transitions at once.
Use the new onTransitions(perform:)
or subscribeTransitions(perform:)
methods to observe all transitions.
Temporarily subscribeTransitions
of your State Machines and bind the callbacks to the lifetime of your View Controllers. Just don't forget to store the subscription to bind self
as weak
or unowned
.
- Requires Swift 5
- Previously passing
Transition.nilTransition
toStateMachine.onTransitions(like:perform:)
did never trigger theperform
handler and was therefore useless. Now it will always be triggered.
- Deprecated
StateMachine.onTransitions(transition:perform:)
in favor ofStateMachine.onTransitions(like:perform:)
. - The
StateMachine.onTransitions(perform:)
overload forStateMachine.onTransitions(perform:)
. - Adds temporary observation of transitions
subscribeTransitions(like:perform:)
,subscribeTransitions(perform:)
,subscribeTransitions(from:perform:)
,subscribeTransitions(to:perform:)
,subscribeTransitions(from:to:perform:)
. All return aReferenceDisposable
which needs to be stored as a strong reference. On deinit, the handler will be freed.
First bump your dependency version of Finite to 4.0.0
.
When you compile your project, you won't experience compile errors. Instead you will receive compiler warnings whenever you used StateMachine.onTransitions(transition:perform:)
. If there are no warnings, you already finished the upgrade.
In case you passed .nilTransition
: this did never work. Your perform
operation has never been called!
Starting from 4.0.0, .nilTransition
operations will always be called.
In case you did not pass a .nilTransition
, apply the fix-it and use onTransitions(like:perform:)
instead.
- Avoid assertion failure by combining hash values instead of summing them up - @iLuke93 @snofla
- Introduced graphviz compatible descriptions - @snofla
Released: 2017-10-06
- Readme updates - @vknabel
- Proven Swift 4.0 support - @vknabel
Released: 2016-09-26
- Fixes Testing error - @vknabel
Released: 2016-09-26
- Added support for Travis builds - @vknabel
- Added test support for Linux - @vknabel
- Updated docs - @vknabel
Released: 2016-09-08
- Dropped Swift 2.2 and 2.3 support - @vknabel
Released: 2016-08-22
- Renamed Project from
StateMachine
toFinite
- @vknabel - Renamed
StateMachine.triggerTransition(to:)
toStateMachine.transition(to:)
- @vknabel StateMachine.transition(to:)
throwsTransitionError
and rethrows - @vknabel
Operation
s may now throw - @vknabel- Added
TransitionError
- @vknabel - Added Swift 3.0 Support - @vknabel
- Added generated Docs - @vknabel
- Added
CocoaPods
andSwift Package Manager
support - @vknabel - Started this
CHANGELOG
.