dceb3ca07d
- Add MobileNet classifier - Add average color for each cap - Add option to show average colors in mosaic
68 lines
1.6 KiB
Swift
68 lines
1.6 KiB
Swift
//
|
|
// 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")
|
|
}
|
|
}
|
|
|
|
static var lastUploadedCapCount: Int {
|
|
get {
|
|
return UserDefaults.standard.integer(forKey: "lastUploadedCaps")
|
|
}
|
|
set {
|
|
UserDefaults.standard.set(newValue, forKey: "lastUploadedCaps")
|
|
}
|
|
}
|
|
|
|
static var lastUploadedImageCount: Int {
|
|
get {
|
|
return UserDefaults.standard.integer(forKey: "lastUploadedImages")
|
|
}
|
|
set {
|
|
UserDefaults.standard.set(newValue, forKey: "lastUploadedImages")
|
|
}
|
|
}
|
|
|
|
static var useMobileNet: Bool {
|
|
get {
|
|
return UserDefaults.standard.bool(forKey: "mobileNet")
|
|
}
|
|
|
|
set {
|
|
UserDefaults.standard.set(newValue, forKey: "mobileNet")
|
|
}
|
|
}
|
|
|
|
static var folderNotCreated: [Int] {
|
|
get {
|
|
return UserDefaults.standard.array(forKey: "folders") as? [Int] ?? []
|
|
}
|
|
set {
|
|
UserDefaults.standard.set(newValue, forKey: "folders")
|
|
}
|
|
}
|
|
}
|