A super lite chronology tracker to save and navigate application states (or any data you want).
No dependencies, lightweight & fully portable.
The funcionalities of Tardis are intentionally cut to the bone to provide a basic (yet very effective) way to keep a chronology of the state in a Redux-like architecture.
- Create a Tardis instance
let stateTracker = Tardis<AppState>()
- Save snapshots of the application state (or any other data you want to track)
stateTracker.save(snapshot: appState)
- Make your application time-travel!
if stateTracker.hasPrevious {
appState = stateTracker.previous()
}
if stateTracker.hasNext {
appState = stateTracker.next()
}
appState = stateTracker.oldest()
appState = stateTracker.latest()
- Discard all snapshots and restart with new tracking
stateTracker.reboot(with: appState)
And that's almost all. Check documentation comments in quick help for more details about specific functions.
You can install Tardis using CocoaPods.
use_frameworks!
pod 'Tardis'
- If you've found a bug, open an issue;
- If you have a feature request, open an issue;
- If you want to contribute, submit a pull request;
Tardis is available under the MIT license.