Lots of changes
This commit is contained in:
8
Schedule ICTIS/ViewModel/EditClassViewModel.swift
Normal file
8
Schedule ICTIS/ViewModel/EditClassViewModel.swift
Normal file
@ -0,0 +1,8 @@
|
||||
//
|
||||
// EditClassViewModel.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 18.12.2024.
|
||||
//
|
||||
|
||||
import Foundation
|
33
Schedule ICTIS/ViewModel/Model/Class.swift
Normal file
33
Schedule ICTIS/ViewModel/Model/Class.swift
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Class.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by Mironov Egor on 18.12.2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
final class Class: NSManagedObject {
|
||||
@NSManaged var auditory: String
|
||||
@NSManaged var professor: String
|
||||
@NSManaged var subject: String
|
||||
@NSManaged var comment: String
|
||||
@NSManaged var notification: String
|
||||
@NSManaged var day: Date
|
||||
@NSManaged var starttime: Date
|
||||
@NSManaged var endtime: Date
|
||||
@NSManaged var important: Bool
|
||||
|
||||
// Здесь мы выполняем дополнительную инициализацию, назначая значения по умолчанию
|
||||
override func awakeFromInsert() {
|
||||
super.awakeFromInsert()
|
||||
|
||||
setPrimitiveValue("", forKey: "auditory")
|
||||
setPrimitiveValue("", forKey: "professor")
|
||||
setPrimitiveValue("", forKey: "subject")
|
||||
setPrimitiveValue("", forKey: "comment")
|
||||
setPrimitiveValue("Нет", forKey: "notification")
|
||||
setPrimitiveValue(false, forKey: "important")
|
||||
}
|
||||
}
|
23
Schedule ICTIS/ViewModel/Model/ScheduleModel.swift
Normal file
23
Schedule ICTIS/ViewModel/Model/ScheduleModel.swift
Normal file
@ -0,0 +1,23 @@
|
||||
//
|
||||
// Model.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by Mironov Egor on 13.11.2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - Welcome
|
||||
struct Schedule: Decodable {
|
||||
let table: Table
|
||||
let weeks: [Int]
|
||||
}
|
||||
|
||||
// MARK: - Table
|
||||
struct Table: Decodable {
|
||||
let type, name: String
|
||||
let week: Int
|
||||
let group: String
|
||||
let table: [[String]]
|
||||
let link: String
|
||||
}
|
14
Schedule ICTIS/ViewModel/Model/TabBarModel.swift
Normal file
14
Schedule ICTIS/ViewModel/Model/TabBarModel.swift
Normal file
@ -0,0 +1,14 @@
|
||||
//
|
||||
// Tab.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 13.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
enum TabBarModel: String, CaseIterable {
|
||||
case schedule = "house"
|
||||
case tasks = "books.vertical"
|
||||
case settings = "gear"
|
||||
}
|
8
Schedule ICTIS/ViewModel/Provider/ClassProvider.swift
Normal file
8
Schedule ICTIS/ViewModel/Provider/ClassProvider.swift
Normal file
@ -0,0 +1,8 @@
|
||||
//
|
||||
// ClassProvider.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 18.12.2024.
|
||||
//
|
||||
|
||||
import Foundation
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
final class ViewModel: ObservableObject {
|
||||
final class ScheduleViewModel: ObservableObject {
|
||||
//MARK: Properties
|
||||
@Published var weekSchedule: Table = Table(
|
||||
type: "",
|
Reference in New Issue
Block a user