Commit
This commit is contained in:
parent
155a175635
commit
0410575c8d
@ -2,7 +2,7 @@
|
||||
// ContentView.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 13.11.2024.
|
||||
// Created by Mironov Egor on 13.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Date+Extensions.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 14.11.2024.
|
||||
// Created by Mironov Egor on 14.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
@ -2,7 +2,7 @@
|
||||
// OffsetKey.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 18.11.2024.
|
||||
// Created by Mironov Egor on 18.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
@ -2,7 +2,7 @@
|
||||
// View+Extensions.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 15.11.2024.
|
||||
// Created by Mironov Egor on 15.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
@ -1,8 +1,8 @@
|
||||
//
|
||||
// ViewModel.swift
|
||||
// Model.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 13.11.2024.
|
||||
// Created by Mironov Egor on 13.11.2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// NetworkError.swift
|
||||
// NewsApp
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by Mironov Egor on 18.11.2024.
|
||||
//
|
||||
|
@ -1,8 +1,8 @@
|
||||
//
|
||||
// NetworkManager.swift
|
||||
// NewsApp
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by Egor Mironov on 18.11.2024.
|
||||
// Created by Mironov Egor on 18.11.2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@ -12,7 +12,8 @@ final class NetworkManager {
|
||||
//MARK: Properties
|
||||
static let shared = NetworkManager()
|
||||
private let decoder = JSONDecoder()
|
||||
private let urlString = "https://webictis.sfedu.ru/schedule-api/?query=%D0%BA%D1%82%D0%B1%D0%BE2-6"
|
||||
private let urlForGroup = "https://webictis.sfedu.ru/schedule-api/?query=ктбо2-6"
|
||||
private let urlForWeek = "https://webictis.sfedu.ru/schedule-api/?group=51.html&week=15"
|
||||
|
||||
//MARK: Initializer
|
||||
private init() {
|
||||
@ -21,7 +22,7 @@ final class NetworkManager {
|
||||
|
||||
//MARK: Methods
|
||||
func getSchedule() async throws -> Schedule {
|
||||
guard let url = URL(string: urlString) else { throw NetworkError.invalidUrl}
|
||||
guard let url = URL(string: urlForGroup) else { throw NetworkError.invalidUrl}
|
||||
let (data, response) = try await URLSession.shared.data(from: url)
|
||||
guard let response = response as? HTTPURLResponse, response.statusCode == 200 else {throw NetworkError.invalidResponse}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// ScheduleView.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 13.11.2024.
|
||||
// Created by Mironov Egor on 13.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
@ -13,7 +13,7 @@ struct ScheduleView: View {
|
||||
@State private var weekSlider: [[Date.WeekDay]] = []
|
||||
@State private var currentWeekIndex: Int = 1
|
||||
@State private var createWeek: Bool = false
|
||||
@StateObject var vm = ViewModel()
|
||||
@ObservedObject var vm = ViewModel()
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
@ -61,6 +61,7 @@ struct ScheduleView: View {
|
||||
.cornerRadius(20)
|
||||
.padding(.horizontal, 10)
|
||||
.frame(maxWidth: 420, maxHeight: 130)
|
||||
.shadow(color: Color.black.opacity(0.1), radius: 2, x: 4, y: 4)
|
||||
}
|
||||
.frame(height: 70)
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Schedule_ICTISApp.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by G412 on 13.11.2024.
|
||||
// Created by Mironov Egor on 13.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
@ -1,3 +1,10 @@
|
||||
//
|
||||
// SearchBarView.swift
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by Mironov Egor on 13.11.2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SearchBarView: View {
|
||||
@ -5,7 +12,7 @@ struct SearchBarView: View {
|
||||
@State private var isEditing = false
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
HStack (spacing: 10) {
|
||||
HStack (spacing: 0) {
|
||||
Image(systemName: "magnifyingglass")
|
||||
.foregroundColor(Color.gray)
|
||||
@ -19,12 +26,6 @@ struct SearchBarView: View {
|
||||
.onSubmit {
|
||||
self.isEditing = false
|
||||
}
|
||||
ZStack {
|
||||
Rectangle()
|
||||
.frame(width: 40, height: 40)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(15)
|
||||
Group {
|
||||
if isEditing {
|
||||
Button {
|
||||
self.text = ""
|
||||
@ -41,19 +42,17 @@ struct SearchBarView: View {
|
||||
.background(Color.white)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(height: 40)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.fill(.white)
|
||||
)
|
||||
Spacer()
|
||||
Button {
|
||||
|
||||
} label: {
|
||||
ZStack {
|
||||
Rectangle()
|
||||
.frame(width: 40)
|
||||
.frame(width: 40, height: 40)
|
||||
.foregroundStyle(Color("blueColor"))
|
||||
.cornerRadius(15)
|
||||
Image(systemName: "plus")
|
||||
|
@ -1,6 +1,6 @@
|
||||
//
|
||||
// ViewModel.swift
|
||||
// NewsApp
|
||||
// Schedule ICTIS
|
||||
//
|
||||
// Created by Mironov Egor on 18.11.2024.
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user