Lessons implementation
This commit is contained in:
22
Toki Trainer/ViewModels/FlashCardLessonsViewModel.swift
Normal file
22
Toki Trainer/ViewModels/FlashCardLessonsViewModel.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// FlashCardLessonsViewModel.swift
|
||||
// Toki Trainer
|
||||
//
|
||||
// Created by Avery Ada Pace on 11/8/21.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class FlashCardLessonsViewModel: ObservableObject {
|
||||
|
||||
let jsonLoader: TokiJSONLoader = TokiJSONLoader()
|
||||
|
||||
@Published var lessons: [TokiLesson] = []
|
||||
|
||||
|
||||
init() {
|
||||
if let safeLessons = jsonLoader.loadLessons() {
|
||||
lessons = safeLessons
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user