A WIP iOS app for Mastodon and Pleroma.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tusker/Tusker/LocalData.swift

70 lines
1.5 KiB

//
// 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() {
}
}