2021-11-06 17:35:56 +00:00
|
|
|
//
|
|
|
|
// FlashCardsViewModel.swift
|
|
|
|
// Toki Trainer
|
|
|
|
//
|
|
|
|
// Created by Avery Ada Pace on 11/6/21.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
class FlashCardsViewModel: ObservableObject {
|
|
|
|
|
|
|
|
let jsonLoader = TokiJSONLoader()
|
|
|
|
|
|
|
|
private var fullDictionary: [TokiDictEntry] = []
|
|
|
|
@Published var randomDictionary: [TokiDictEntry] = []
|
|
|
|
|
|
|
|
init() {
|
|
|
|
if let safeDictionary = jsonLoader.loadDictionary() {
|
|
|
|
fullDictionary = safeDictionary
|
|
|
|
randomDictionary = safeDictionary
|
2021-11-07 22:15:11 +00:00
|
|
|
//randomDictionary.shuffle()
|
2021-11-06 17:35:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|