Lots of changes

This commit is contained in:
Vladimir Dubovik 2024-12-20 13:26:50 +03:00
parent 3fad13097a
commit 1eb574e682
45 changed files with 757 additions and 71 deletions

8
Class.swift Normal file
View File

@ -0,0 +1,8 @@
//
// Class.swift
// Schedule ICTIS
//
// Created by G412 on 18.12.2024.
//
import Foundation

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="23605" systemVersion="24C101" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithSwiftData="YES" userDefinedModelVersionIdentifier=""/>

View File

@ -7,7 +7,7 @@
import SwiftUI
struct CommentView: View {
struct CommentFieldView: View {
@Binding var textForComment: String
@FocusState private var isFocused: Bool

View File

@ -7,7 +7,7 @@
import SwiftUI
struct FieldView: View {
struct ProfessorAuditoryClassFieldView: View {
@Binding var text: String
var nameOfImage: String
var labelForField: String

View File

@ -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: "Начало")
}

View File

@ -15,7 +15,7 @@ struct LoadingView: View {
.ignoresSafeArea()
ProgressView()
.progressViewStyle(CircularProgressViewStyle(tint: .secondary))
.scaleEffect(1.2)
.scaleEffect(1)
}
}
}

View File

@ -13,7 +13,7 @@ struct SheetChangeClassView: View {
NavigationView {
VStack {
Spacer()
Text("Создание новой пары")
Text("Редактирвоание пары")
Spacer()
}
.toolbar {

View File

@ -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)

View File

@ -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()
}

View File

@ -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")
}
}

View File

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,14 @@
{
"images" : [
{
"filename" : "ICTIS_logo.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

View File

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -0,0 +1,8 @@
//
// ClassProvider.swift
// Schedule ICTIS
//
// Created by G412 on 18.12.2024.
//
import Foundation

View 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")
}
}

View 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
}

View 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"
}

View File

@ -0,0 +1,8 @@
//
// ClassProvider.swift
// Schedule ICTIS
//
// Created by G412 on 18.12.2024.
//
import Foundation

View File

@ -0,0 +1,8 @@
//
// EditClassViewModel.swift
// Schedule ICTIS
//
// Created by G412 on 18.12.2024.
//
import Foundation

View 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")
}
}

View 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
}

View 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"
}

View File

@ -0,0 +1,8 @@
//
// ClassProvider.swift
// Schedule ICTIS
//
// Created by G412 on 18.12.2024.
//
import Foundation

View File

@ -8,7 +8,7 @@
import Foundation
@MainActor
final class ViewModel: ObservableObject {
final class ScheduleViewModel: ObservableObject {
//MARK: Properties
@Published var weekSchedule: Table = Table(
type: "",