forked from shadowfacts/Tusker
71 lines
1.5 KiB
Swift
71 lines
1.5 KiB
Swift
//
|
|
// LocalData.swift
|
|
// Tusker
|
|
//
|
|
// Created by Shadowfacts on 8/18/18.
|
|
// Copyright © 2018 Shadowfacts. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class LocalData {
|
|
|
|
static let shared = LocalData()
|
|
|
|
let defaults = UserDefaults()
|
|
|
|
private let onboardingCompleteKey = "onboardingComplete"
|
|
var onboardingComplete: Bool {
|
|
get {
|
|
return defaults.bool(forKey: onboardingCompleteKey)
|
|
}
|
|
set {
|
|
defaults.set(newValue, forKey: onboardingCompleteKey)
|
|
}
|
|
}
|
|
|
|
private let instanceURLKey = "instanceURL"
|
|
var instanceURL: URL? {
|
|
get {
|
|
return defaults.url(forKey: instanceURLKey)
|
|
}
|
|
set {
|
|
defaults.set(newValue, forKey: instanceURLKey)
|
|
}
|
|
}
|
|
|
|
private let clientIDKey = "clientID"
|
|
var clientID: String? {
|
|
get {
|
|
return defaults.string(forKey: clientIDKey)
|
|
}
|
|
set {
|
|
defaults.set(newValue, forKey: clientIDKey)
|
|
}
|
|
}
|
|
|
|
private let clientSecretKey = "clientSecret"
|
|
var clientSecret: String? {
|
|
get {
|
|
return defaults.string(forKey: clientSecretKey)
|
|
}
|
|
set {
|
|
defaults.set(newValue, forKey: clientSecretKey)
|
|
}
|
|
}
|
|
|
|
private let accessTokenKey = "accessToken"
|
|
var accessToken: String? {
|
|
get {
|
|
return defaults.string(forKey: accessTokenKey)
|
|
}
|
|
set {
|
|
defaults.set(newValue, forKey: accessTokenKey)
|
|
}
|
|
}
|
|
|
|
private init() {
|
|
}
|
|
|
|
}
|