Skip to content

Commit

Permalink
Merge pull request #153 from TeamHY2/Fix/#128-Department
Browse files Browse the repository at this point in the history
[Feature] 학과추가 및 삭제
  • Loading branch information
Seokki-Kwon authored Jan 28, 2025
2 parents ce84d1e + d5b3e0d commit 2f377fd
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 86 deletions.
Binary file modified .DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions HongikYeolgong2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"HongikYeolgong2/Resources/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P4D4ZQC4YF;
Expand All @@ -1586,7 +1586,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.4;
MARKETING_VERSION = 1.1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1611,7 +1611,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"HongikYeolgong2/Resources/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P4D4ZQC4YF;
Expand All @@ -1633,7 +1633,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.4;
MARKETING_VERSION = 1.1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ final class RankingDataInteractorImpl: RankingDataInteractor {
.getWeekField(date: Date().toDateString())
.flatMap({ [weak self] in
guard let self = self else { return Empty<WeeklyRanking, NetworkError>().eraseToAnyPublisher() }
print($0)
weekNumber = $0
maxWeekNumber = $0
minWeekNumber = $0 - ($0 % 100)
Expand Down
19 changes: 14 additions & 5 deletions HongikYeolgong2/Models/Department.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import Foundation

enum Department: String, CaseIterable {
enum Department: String, CaseIterable {
case none = ""
case constructionUrban = "건설도시공학부"
case civilEnvironmental = "건설환경공학과"
case architecture = "건축학부"
// case architecture = "건축학부"
case business = "경영학부"
case economics = "경제학부"
case performingArts = "공연예술학부"
Expand All @@ -25,16 +25,16 @@ enum Department: String, CaseIterable {
case ceramics = "도예유리과"
case designManagement = "디자인경영융합학부"
case designArtManagement = "디자인·예술경영학부"
case design = "디자인학부"
// case design = "디자인학부"
case physicsEdu = "물리교육과"
case law = "법학부"
case frenchLit = "불어불문학과"
case socialEdu = "사회교육과"
case industrialDesign = "산업디자인학과"
// case industrialDesign = "산업디자인학과"
case industrialData = "산업·데이터공학과"
case textileFashion = "섬유미술패션디자인과"
case mathEdu = "수학교육과"
case materials = "신소재화공시스템공학부"
// case materials = "신소재화공시스템공학부"
case englishEdu = "영어교육과"
case englishLit = "영어영문학과"
case historyEdu = "역사교육과"
Expand All @@ -45,6 +45,15 @@ enum Department: String, CaseIterable {
case computerScience = "컴퓨터공학과"
case frenchStudies = "프랑스어문학과"
case painting = "회화과"
case architecture5Years = "건축학전공(5년제)"
case interiorArchitecture = "실내건축학전공"
case materialsEngineering = "신소재공학전공"
case chemicalEngineering = "화학공학전공"
case japaneseLiterature = "일본어문학과"
// case printmaking = "판화과"
case visualDesign = "시각디자인전공"
case industrialDesignMajor = "산업디자인전공"
case autonomousMajor = "캠퍼스자율전공"

static var allDepartments: [String] {
Self.allCases.filter { $0 != .none }.map { $0.rawValue }
Expand Down
141 changes: 73 additions & 68 deletions HongikYeolgong2/Presentation/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,77 +39,82 @@ struct HomeView: View {
}

var content: some View {
VStack(spacing: 0) {
WeeklyStudyView(studyRecords: studyRecords.value ?? [WeeklyStudyRecord]())

StudyContentControllerView(
studySession: $studySession,
wiseSaying: wiseSaying.value ?? WiseSaying()
)

Spacer()

ActionButtonControllerView(
studySession: $studySession,
actions: .init(
endButtonTapped: endButtonTapped,
startButtonTapped: startButtonTapped,
seatButtonTapped: seatButtonTapped,
addButtonTapped: addButtonTapped
NavigationStack {
VStack(spacing: 0) {
WeeklyStudyView(studyRecords: studyRecords.value ?? [WeeklyStudyRecord]())

StudyContentControllerView(
studySession: $studySession,
wiseSaying: wiseSaying.value ?? WiseSaying()
)
)

NavigationLink("",
destination: WebViewWithNavigation(url: SecretKeys.roomStatusUrl, title: "좌석")
.edgesIgnoringSafeArea(.bottom),
isActive: $isShowWebView)
.frame(width: 0, height: 0)
}
.systemOverlay(isPresented: $isShowTimePicker) {
TimePickerView(
selectedTime: Binding(
get: { appState.value.studySession.startTime },
set: { studySessionInteractor.setStartTime($0) }
),
onTimeSelected: startStudy
)
}
.systemOverlay(isPresented: $isShowAddTimeModal) {
ModalView(isPresented: $isShowAddTimeModal,
title: "열람실 이용 시간을 연장할까요?",
confirmButtonText: "연장하기",
cancleButtonText: "아니오",
confirmAction: { studySessionInteractor.addTime() })
}
.systemOverlay(isPresented: $isShowEndUseModal) {
ModalView(isPresented: $isShowEndUseModal,
title: "열람실을 다 이용하셨나요?",
confirmButtonText: "",
cancleButtonText: "더 이용하기",
confirmAction: endStudy )
}
.padding(.horizontal, 32.adjustToScreenWidth)
.modifier(IOSBackground())
.onAppear {
if !isViewOnAppeared {
isViewOnAppeared = true

Spacer()

ActionButtonControllerView(
studySession: $studySession,
actions: .init(
endButtonTapped: endButtonTapped,
startButtonTapped: startButtonTapped,
seatButtonTapped: seatButtonTapped,
addButtonTapped: addButtonTapped
)
)
}
.systemOverlay(isPresented: $isShowTimePicker) {
TimePickerView(
selectedTime: Binding(
get: { appState.value.studySession.startTime },
set: { studySessionInteractor.setStartTime($0) }
),
onTimeSelected: startStudy
)
}
.systemOverlay(isPresented: $isShowAddTimeModal) {
ModalView(isPresented: $isShowAddTimeModal,
title: "열람실 이용 시간을 연장할까요?",
confirmButtonText: "연장하기",
cancleButtonText: "아니오",
confirmAction: { studySessionInteractor.addTime() })
}
.systemOverlay(isPresented: $isShowEndUseModal) {
ModalView(isPresented: $isShowEndUseModal,
title: "열람실을 다 이용하셨나요?",
confirmButtonText: "",
cancleButtonText: "더 이용하기",
confirmAction: endStudy )
}
.padding(.horizontal, 32.adjustToScreenWidth)
.modifier(IOSBackground())

.onAppear {
if !isViewOnAppeared {
isViewOnAppeared = true
weeklyStudyInteractor.getWeekyStudy(studyRecords: $studyRecords)
weeklyStudyInteractor.getWiseSaying(wiseSaying: $wiseSaying)
}
}
.onReceive(studySessionUpdated) {
studySession = $0
}
.onReceive(studySessionEnded) { _ in
endStudy()
}
.onReceive(studySessionUploaded) { _ in
weeklyStudyInteractor.getWeekyStudy(studyRecords: $studyRecords)
weeklyStudyInteractor.getWiseSaying(wiseSaying: $wiseSaying)
}
}
.onReceive(studySessionUpdated) {
studySession = $0
}
.onReceive(studySessionEnded) { _ in
endStudy()
}
.onReceive(studySessionUploaded) { _ in
weeklyStudyInteractor.getWeekyStudy(studyRecords: $studyRecords)
}
.onReceive(scenePhaseUpdated) {
$0 == .active
? studySessionInteractor.resumeStudy()
: studySessionInteractor.pauseStudy()
.onReceive(scenePhaseUpdated) {
$0 == .active
? studySessionInteractor.resumeStudy()
: studySessionInteractor.pauseStudy()
}
.navigationDestination(for: Page.self, destination: { page in
switch page {
case let .webView(title, url):
WebViewWithNavigation(url: url, title: title)
default:
EmptyView()
}
})
}
}
}
Expand Down
12 changes: 3 additions & 9 deletions HongikYeolgong2/UI/Modifier/SystemOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,20 @@
import SwiftUI

struct SystemOverlay<ContentView: View>: ViewModifier {
@State var viewAppear = false
@Binding var isPresented: Bool
let contentView: () -> ContentView

func body(content: Content) -> some View {
content
.fullScreenCover(isPresented: $isPresented) {
ZStack {
Color.black.opacity(0.75).ignoresSafeArea(.all)
contentView()
.onAppear {
viewAppear = true
}
contentView()
}
.background(ClearBackgroundView())
}
.transaction { transaction in
if viewAppear || isPresented {
transaction.disablesAnimations = true
viewAppear = false
}
transaction.disablesAnimations = isPresented
}
}
}
Expand Down

0 comments on commit 2f377fd

Please sign in to comment.