diff --git a/Class.swift b/Class.swift new file mode 100644 index 0000000..e8d6e56 --- /dev/null +++ b/Class.swift @@ -0,0 +1,8 @@ +// +// Class.swift +// Schedule ICTIS +// +// Created by G412 on 18.12.2024. +// + +import Foundation diff --git a/ClassDataModel.xcdatamodeld/ClassDataModel.xcdatamodel/contents b/ClassDataModel.xcdatamodeld/ClassDataModel.xcdatamodel/contents new file mode 100644 index 0000000..2f123c7 --- /dev/null +++ b/ClassDataModel.xcdatamodeld/ClassDataModel.xcdatamodel/contents @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Schedule ICTIS/Main/Views/CommentView.swift b/Schedule ICTIS/Main/Views/Fields/CommentFieldView.swift similarity index 97% rename from Schedule ICTIS/Main/Views/CommentView.swift rename to Schedule ICTIS/Main/Views/Fields/CommentFieldView.swift index 78fa257..4c6aea8 100644 --- a/Schedule ICTIS/Main/Views/CommentView.swift +++ b/Schedule ICTIS/Main/Views/Fields/CommentFieldView.swift @@ -7,7 +7,7 @@ import SwiftUI -struct CommentView: View { +struct CommentFieldView: View { @Binding var textForComment: String @FocusState private var isFocused: Bool diff --git a/Schedule ICTIS/Main/Views/FieldView.swift b/Schedule ICTIS/Main/Views/Fields/ProfessorAuditoryClassFieldView.swift similarity index 96% rename from Schedule ICTIS/Main/Views/FieldView.swift rename to Schedule ICTIS/Main/Views/Fields/ProfessorAuditoryClassFieldView.swift index ce6c3ad..7961b7f 100644 --- a/Schedule ICTIS/Main/Views/FieldView.swift +++ b/Schedule ICTIS/Main/Views/Fields/ProfessorAuditoryClassFieldView.swift @@ -7,7 +7,7 @@ import SwiftUI -struct FieldView: View { +struct ProfessorAuditoryClassFieldView: View { @Binding var text: String var nameOfImage: String var labelForField: String diff --git a/Schedule ICTIS/Main/Views/StartEndTimeView.swift b/Schedule ICTIS/Main/Views/Fields/StartEndTimeFieldView.swift similarity index 92% rename from Schedule ICTIS/Main/Views/StartEndTimeView.swift rename to Schedule ICTIS/Main/Views/Fields/StartEndTimeFieldView.swift index b036af6..8eb486c 100644 --- a/Schedule ICTIS/Main/Views/StartEndTimeView.swift +++ b/Schedule ICTIS/Main/Views/Fields/StartEndTimeFieldView.swift @@ -7,7 +7,7 @@ import SwiftUI -struct StartEndTimeView: View { +struct StartEndTimeFieldView: View { @Binding var selectedTime: Date var imageName: String var text: String @@ -55,5 +55,5 @@ struct StartEndTimeView: View { } #Preview { - StartEndTimeView(selectedTime: .constant(Date()), imageName: "clock", text: "Начало") + StartEndTimeFieldView(selectedTime: .constant(Date()), imageName: "clock", text: "Начало") } diff --git a/Schedule ICTIS/Main/Views/LoadingView.swift b/Schedule ICTIS/Main/Views/LoadingView.swift index 81fc7ec..e3f940e 100644 --- a/Schedule ICTIS/Main/Views/LoadingView.swift +++ b/Schedule ICTIS/Main/Views/LoadingView.swift @@ -15,7 +15,7 @@ struct LoadingView: View { .ignoresSafeArea() ProgressView() .progressViewStyle(CircularProgressViewStyle(tint: .secondary)) - .scaleEffect(1.2) + .scaleEffect(1) } } } diff --git a/Schedule ICTIS/Main/Views/SheetChangeClassView.swift b/Schedule ICTIS/Main/Views/Sheets/SheetChangeClassView.swift similarity index 93% rename from Schedule ICTIS/Main/Views/SheetChangeClassView.swift rename to Schedule ICTIS/Main/Views/Sheets/SheetChangeClassView.swift index ac27068..4637177 100644 --- a/Schedule ICTIS/Main/Views/SheetChangeClassView.swift +++ b/Schedule ICTIS/Main/Views/Sheets/SheetChangeClassView.swift @@ -13,7 +13,7 @@ struct SheetChangeClassView: View { NavigationView { VStack { Spacer() - Text("Создание новой пары") + Text("Редактирвоание пары") Spacer() } .toolbar { diff --git a/Schedule ICTIS/Main/Views/SheetCreateClassView.swift b/Schedule ICTIS/Main/Views/Sheets/SheetCreateClassView.swift similarity index 85% rename from Schedule ICTIS/Main/Views/SheetCreateClassView.swift rename to Schedule ICTIS/Main/Views/Sheets/SheetCreateClassView.swift index 89ea1d0..6b6b5ac 100644 --- a/Schedule ICTIS/Main/Views/SheetCreateClassView.swift +++ b/Schedule ICTIS/Main/Views/Sheets/SheetCreateClassView.swift @@ -24,11 +24,11 @@ struct SheetCreateClassView: View { NavigationView { ScrollView(.vertical, showsIndicators: false) { VStack { - FieldView(text: $textForNameOfClass, nameOfImage: "book", labelForField: "Предмет") + ProfessorAuditoryClassFieldView(text: $textForNameOfClass, nameOfImage: "book", labelForField: "Предмет") .padding(.bottom, 10) - FieldView(text: $textForNameOfAuditory, nameOfImage: "mappin.and.ellipse", labelForField: "Корпус-аудитория") + ProfessorAuditoryClassFieldView(text: $textForNameOfAuditory, nameOfImage: "mappin.and.ellipse", labelForField: "Корпус-аудитория") .padding(.bottom, 10) - FieldView(text: $textForNameOfProfessor, nameOfImage: "book", labelForField: "Преподаватель") + ProfessorAuditoryClassFieldView(text: $textForNameOfProfessor, nameOfImage: "book", labelForField: "Преподаватель") .padding(.bottom, 10) HStack { Image(systemName: "calendar") @@ -55,9 +55,9 @@ struct SheetCreateClassView: View { } .padding(.bottom, 10) HStack { - StartEndTimeView(selectedTime: $selectedStartTime, imageName: "clock", text: "Начало") + StartEndTimeFieldView(selectedTime: $selectedStartTime, imageName: "clock", text: "Начало") Spacer() - StartEndTimeView(selectedTime: $selectedEndTime, imageName: "clock.badge.xmark", text: "Конец") + StartEndTimeFieldView(selectedTime: $selectedEndTime, imageName: "clock.badge.xmark", text: "Конец") } .frame(height: 40) .padding(.bottom, 10) @@ -88,7 +88,7 @@ struct SheetCreateClassView: View { ) .padding(.bottom, 10) - CommentView(textForComment: $textForComment) + CommentFieldView(textForComment: $textForComment) Spacer() } .padding(.horizontal) diff --git a/Schedule ICTIS/Main/TabBar/TabBarView.swift b/Schedule ICTIS/Main/Views/TabBar/TabBarView.swift similarity index 100% rename from Schedule ICTIS/Main/TabBar/TabBarView.swift rename to Schedule ICTIS/Main/Views/TabBar/TabBarView.swift diff --git a/Schedule ICTIS/Main/TabViews/MonthTabView.swift b/Schedule ICTIS/Main/Views/TabViews/MonthTabView.swift similarity index 100% rename from Schedule ICTIS/Main/TabViews/MonthTabView.swift rename to Schedule ICTIS/Main/Views/TabViews/MonthTabView.swift diff --git a/Schedule ICTIS/Main/TabViews/WeekTabView.swift b/Schedule ICTIS/Main/Views/TabViews/WeekTabView.swift similarity index 100% rename from Schedule ICTIS/Main/TabViews/WeekTabView.swift rename to Schedule ICTIS/Main/Views/TabViews/WeekTabView.swift diff --git a/Schedule ICTIS/Main/Views/TextFiledView.swift b/Schedule ICTIS/Main/Views/TextFiledView.swift deleted file mode 100644 index 6abf975..0000000 --- a/Schedule ICTIS/Main/Views/TextFiledView.swift +++ /dev/null @@ -1,58 +0,0 @@ -// -// TextFiledView.swift -// Schedule ICTIS -// -// Created by G412 on 17.12.2024. -// - -import SwiftUI - -struct TextFiledView: View { - @State private var isEditing: Bool = false - @State private var text: String = "" - @State private var nameOfImage: String = "calendar" - @State private var labelForField: String = "Преподаватель" - - @FocusState private var isTextFieldFocused: Bool - - var body: some View { - HStack(spacing: 0) { - Image(systemName: nameOfImage) - .foregroundColor(Color.gray) - .padding(.leading, 12) - .padding(.trailing, 7) - - TextField(labelForField, text: $text) - .font(.system(size: 18, weight: .regular)) - .disableAutocorrection(true) - .focused($isTextFieldFocused) - .onChange(of: isTextFieldFocused) { newValue, oldValue in - isEditing = newValue - } - .submitLabel(.done) - - if isTextFieldFocused { - Button { - self.text = "" - self.isEditing = false - isTextFieldFocused = false - } label: { - Image(systemName: "xmark.circle.fill") - .padding() - .padding(.trailing, 20) - .offset(x: 10) - .foregroundColor(.red) - } - } - } - .frame(height: 40) - .background( - RoundedRectangle(cornerRadius: 10) - .fill(.white) - ) - } -} - -#Preview { - TextFiledView() -} diff --git a/Schedule ICTIS/Model/ClassModel.swift b/Schedule ICTIS/Model/ClassModel.swift new file mode 100644 index 0000000..f43300e --- /dev/null +++ b/Schedule ICTIS/Model/ClassModel.swift @@ -0,0 +1,33 @@ +// +// Class.swift +// Schedule ICTIS +// +// Created by Mironov Egor on 18.12.2024. +// + +import Foundation +import CoreData + +final class ClassModel: 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") + } +} diff --git a/Schedule ICTIS/Model/Model.swift b/Schedule ICTIS/Model/ScheduleModel.swift similarity index 100% rename from Schedule ICTIS/Model/Model.swift rename to Schedule ICTIS/Model/ScheduleModel.swift diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/AccentColor.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/AppIcon.appiconset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..080ba9c --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "ICTIS_logo.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/AppIcon.appiconset/ICTIS_logo.png b/Schedule ICTIS/Preview Content/Assets.xcassets/AppIcon.appiconset/ICTIS_logo.png new file mode 100644 index 0000000..44b05e5 Binary files /dev/null and b/Schedule ICTIS/Preview Content/Assets.xcassets/AppIcon.appiconset/ICTIS_logo.png differ diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/arrowdown.imageset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowdown.imageset/Contents.json new file mode 100644 index 0000000..4ce8416 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowdown.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "arrow.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/arrowdown.imageset/arrow.png b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowdown.imageset/arrow.png new file mode 100644 index 0000000..68f840b Binary files /dev/null and b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowdown.imageset/arrow.png differ diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/arrowup.imageset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowup.imageset/Contents.json new file mode 100644 index 0000000..446d6be --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowup.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Vector.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/arrowup.imageset/Vector.png b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowup.imageset/Vector.png new file mode 100644 index 0000000..4d0fca6 Binary files /dev/null and b/Schedule ICTIS/Preview Content/Assets.xcassets/arrowup.imageset/Vector.png differ diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/background.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/background.colorset/Contents.json new file mode 100644 index 0000000..5cdfbad --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/background.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF6", + "green" : "0xF0", + "red" : "0xF1" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/blueColor.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/blueColor.colorset/Contents.json new file mode 100644 index 0000000..5b28f5e --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/blueColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xA4", + "green" : "0x60", + "red" : "0x28" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xA4", + "green" : "0x60", + "red" : "0x28" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/blueForOnline.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/blueForOnline.colorset/Contents.json new file mode 100644 index 0000000..213c5b9 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/blueForOnline.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0x7A", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/customGray1.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/customGray1.colorset/Contents.json new file mode 100644 index 0000000..ea75ab6 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/customGray1.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD9", + "green" : "0xD9", + "red" : "0xD9" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD9", + "green" : "0xD9", + "red" : "0xD9" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/customGray2.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/customGray2.colorset/Contents.json new file mode 100644 index 0000000..80b1768 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/customGray2.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7D", + "green" : "0x7D", + "red" : "0x7D" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7D", + "green" : "0x7D", + "red" : "0x7D" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/customGray3.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/customGray3.colorset/Contents.json new file mode 100644 index 0000000..80b1768 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/customGray3.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7D", + "green" : "0x7D", + "red" : "0x7D" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7D", + "green" : "0x7D", + "red" : "0x7D" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/grayForDate.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/grayForDate.colorset/Contents.json new file mode 100644 index 0000000..a039c0b --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/grayForDate.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7A", + "green" : "0x7A", + "red" : "0x7A" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7A", + "green" : "0x7A", + "red" : "0x7A" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/grayForFields.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/grayForFields.colorset/Contents.json new file mode 100644 index 0000000..58b6ec3 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/grayForFields.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x84", + "green" : "0x80", + "red" : "0x80" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x84", + "green" : "0x80", + "red" : "0x80" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/greenForOffline.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/greenForOffline.colorset/Contents.json new file mode 100644 index 0000000..7aba1dd --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/greenForOffline.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x0A", + "green" : "0x97", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/greyForDaysInMonthTabView.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/greyForDaysInMonthTabView.colorset/Contents.json new file mode 100644 index 0000000..bfc2a11 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/greyForDaysInMonthTabView.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x99", + "green" : "0x99", + "red" : "0x99" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x99", + "green" : "0x99", + "red" : "0x99" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/redForImportant.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/redForImportant.colorset/Contents.json new file mode 100644 index 0000000..1421f31 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/redForImportant.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Preview Content/Assets.xcassets/turquoise.colorset/Contents.json b/Schedule ICTIS/Preview Content/Assets.xcassets/turquoise.colorset/Contents.json new file mode 100644 index 0000000..ba13876 --- /dev/null +++ b/Schedule ICTIS/Preview Content/Assets.xcassets/turquoise.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xDE", + "green" : "0xE4", + "red" : "0x22" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xDE", + "green" : "0xE4", + "red" : "0x22" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Schedule ICTIS/Provider/ClassProvider.swift b/Schedule ICTIS/Provider/ClassProvider.swift new file mode 100644 index 0000000..74a906a --- /dev/null +++ b/Schedule ICTIS/Provider/ClassProvider.swift @@ -0,0 +1,8 @@ +// +// ClassProvider.swift +// Schedule ICTIS +// +// Created by G412 on 18.12.2024. +// + +import Foundation diff --git a/Schedule ICTIS/Utilities/Model/Class.swift b/Schedule ICTIS/Utilities/Model/Class.swift new file mode 100644 index 0000000..a302649 --- /dev/null +++ b/Schedule ICTIS/Utilities/Model/Class.swift @@ -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") + } +} diff --git a/Schedule ICTIS/Utilities/Model/ScheduleModel.swift b/Schedule ICTIS/Utilities/Model/ScheduleModel.swift new file mode 100644 index 0000000..a3ab6f6 --- /dev/null +++ b/Schedule ICTIS/Utilities/Model/ScheduleModel.swift @@ -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 +} diff --git a/Schedule ICTIS/Utilities/Model/TabBarModel.swift b/Schedule ICTIS/Utilities/Model/TabBarModel.swift new file mode 100644 index 0000000..b0ce5a2 --- /dev/null +++ b/Schedule ICTIS/Utilities/Model/TabBarModel.swift @@ -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" +} diff --git a/Schedule ICTIS/Utilities/Provider/ClassProvider.swift b/Schedule ICTIS/Utilities/Provider/ClassProvider.swift new file mode 100644 index 0000000..74a906a --- /dev/null +++ b/Schedule ICTIS/Utilities/Provider/ClassProvider.swift @@ -0,0 +1,8 @@ +// +// ClassProvider.swift +// Schedule ICTIS +// +// Created by G412 on 18.12.2024. +// + +import Foundation diff --git a/Schedule ICTIS/ViewModel/EditClassViewModel.swift b/Schedule ICTIS/ViewModel/EditClassViewModel.swift new file mode 100644 index 0000000..9aab8b1 --- /dev/null +++ b/Schedule ICTIS/ViewModel/EditClassViewModel.swift @@ -0,0 +1,8 @@ +// +// EditClassViewModel.swift +// Schedule ICTIS +// +// Created by G412 on 18.12.2024. +// + +import Foundation diff --git a/Schedule ICTIS/ViewModel/Model/Class.swift b/Schedule ICTIS/ViewModel/Model/Class.swift new file mode 100644 index 0000000..a302649 --- /dev/null +++ b/Schedule ICTIS/ViewModel/Model/Class.swift @@ -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") + } +} diff --git a/Schedule ICTIS/ViewModel/Model/ScheduleModel.swift b/Schedule ICTIS/ViewModel/Model/ScheduleModel.swift new file mode 100644 index 0000000..a3ab6f6 --- /dev/null +++ b/Schedule ICTIS/ViewModel/Model/ScheduleModel.swift @@ -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 +} diff --git a/Schedule ICTIS/ViewModel/Model/TabBarModel.swift b/Schedule ICTIS/ViewModel/Model/TabBarModel.swift new file mode 100644 index 0000000..b0ce5a2 --- /dev/null +++ b/Schedule ICTIS/ViewModel/Model/TabBarModel.swift @@ -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" +} diff --git a/Schedule ICTIS/ViewModel/Provider/ClassProvider.swift b/Schedule ICTIS/ViewModel/Provider/ClassProvider.swift new file mode 100644 index 0000000..74a906a --- /dev/null +++ b/Schedule ICTIS/ViewModel/Provider/ClassProvider.swift @@ -0,0 +1,8 @@ +// +// ClassProvider.swift +// Schedule ICTIS +// +// Created by G412 on 18.12.2024. +// + +import Foundation diff --git a/Schedule ICTIS/ViewModel/ViewModel.swift b/Schedule ICTIS/ViewModel/ScheduleViewModel.swift similarity index 98% rename from Schedule ICTIS/ViewModel/ViewModel.swift rename to Schedule ICTIS/ViewModel/ScheduleViewModel.swift index 52f3b33..c98efe2 100644 --- a/Schedule ICTIS/ViewModel/ViewModel.swift +++ b/Schedule ICTIS/ViewModel/ScheduleViewModel.swift @@ -8,7 +8,7 @@ import Foundation @MainActor -final class ViewModel: ObservableObject { +final class ScheduleViewModel: ObservableObject { //MARK: Properties @Published var weekSchedule: Table = Table( type: "",