Caps-iOS/CapCollector/Data/UserDefaults.swift

88 lines
2.1 KiB
Swift
Raw Normal View History

2018-10-17 11:46:16 +02:00
//
// UserDefaults.swift
// CapCollector
//
// Created by Christoph on 16.10.18.
// Copyright © 2018 CH. All rights reserved.
//
import Foundation
final class Persistence {
static var recognizedCapCount: Int {
get {
return UserDefaults.standard.integer(forKey: "recognizedCaps")
}
set {
UserDefaults.standard.set(newValue, forKey: "recognizedCaps")
}
}
static var newImageCount: Int {
get {
return UserDefaults.standard.integer(forKey: "newImages")
}
set {
UserDefaults.standard.set(newValue, forKey: "newImages")
}
}
2019-03-15 13:19:19 +01:00
static var lastUploadedCapCount: Int {
2018-10-17 11:46:16 +02:00
get {
2019-03-15 13:19:19 +01:00
return UserDefaults.standard.integer(forKey: "lastUploadedCaps")
2018-10-17 11:46:16 +02:00
}
set {
2019-03-15 13:19:19 +01:00
UserDefaults.standard.set(newValue, forKey: "lastUploadedCaps")
2018-10-17 11:46:16 +02:00
}
}
2019-03-15 13:19:19 +01:00
static var lastUploadedImageCount: Int {
2018-10-17 11:46:16 +02:00
get {
2019-03-15 13:19:19 +01:00
return UserDefaults.standard.integer(forKey: "lastUploadedImages")
2018-10-17 11:46:16 +02:00
}
set {
2019-03-15 13:19:19 +01:00
UserDefaults.standard.set(newValue, forKey: "lastUploadedImages")
}
}
static var squeezenet: Bool {
get {
return UserDefaults.standard.bool(forKey: "squeezenet")
}
set {
UserDefaults.standard.set(newValue, forKey: "squeezenet")
}
}
static var resnet: Bool {
get {
return UserDefaults.standard.bool(forKey: "resnet")
}
set {
UserDefaults.standard.set(newValue, forKey: "resnet")
}
}
static var xcode: Bool {
get {
return UserDefaults.standard.bool(forKey: "xcode")
}
set {
UserDefaults.standard.set(newValue, forKey: "xcode")
2018-10-17 11:46:16 +02:00
}
}
static var folderNotCreated: [Int] {
get {
return UserDefaults.standard.array(forKey: "folders") as? [Int] ?? []
}
set {
UserDefaults.standard.set(newValue, forKey: "folders")
}
}
2018-10-17 11:46:16 +02:00
}