1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-29 16:56:40 +03:00
vimr/VimR/PrefService.swift
Tae Won Ha 418d1fe1c2
Directly integrate swifter
- Dunno why, but swifter.framework includes many swift related dylibs which are approx. 8MB big.
2017-06-13 00:08:17 +02:00

29 lines
698 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Foundation
fileprivate let defaults = UserDefaults.standard
class PrefService {
typealias MainWindowPair = StateActionPair<AppState, UuidAction<MainWindow.Action>>
static let compatibleVersion = "168"
static let lastCompatibleVersion = "128"
func applyPref<ActionType>(_ pair: StateActionPair<AppState, ActionType>) {
defaults.setValue(pair.state.dict(), forKey: PrefService.compatibleVersion)
}
func applyMainWindow(_ pair: MainWindowPair) {
guard case .close = pair.action.payload else {
return
}
defaults.setValue(pair.state.dict(), forKey: PrefService.compatibleVersion)
}
}