diff --git a/NadoSunbae-iOS/NadoSunbae-iOS/Global/Extension/String+.swift b/NadoSunbae-iOS/NadoSunbae-iOS/Global/Extension/String+.swift index e1cc933c..98302b42 100644 --- a/NadoSunbae-iOS/NadoSunbae-iOS/Global/Extension/String+.swift +++ b/NadoSunbae-iOS/NadoSunbae-iOS/Global/Extension/String+.swift @@ -65,3 +65,43 @@ extension String { } } } + +/// 전공정보 String으로 반환하는 함수 +func convertToMajorInfoString(_ firstMajorName: String, _ firstMajorStart: String, _ secondMajorName: String, _ secondMajorStart: String) -> String { + if secondMajorName == "미진입" { + return firstMajorName + " " + firstMajorStart + " " + "|" + " " + secondMajorName + } else { + return firstMajorName + " " + firstMajorStart + " " + "|" + " " + secondMajorName + " " + secondMajorStart + } +} + +/// 닉네임 + 전공정보 String으로 반환하는 함수 +func convertToUserInfoString(_ nickname: String, _ firstMajorName: String, _ firstMajorStart: String, _ secondMajorName: String, _ secondMajorStart: String) -> String { + if secondMajorName == "미진입" { + return nickname + " " + firstMajorName + " " + firstMajorStart + " | " + secondMajorName + } else { + /// 닉네임 + 본전공명 + 본전공진입시기 + 제2전공 + 제2전공진입시기 글자수 32자 넘을 때 (닉네임 텍스트 크기 고려) + if (nickname.count + firstMajorName.count + firstMajorStart.count + secondMajorName.count + secondMajorStart.count) > 30 { + + if screenWidth == 375 { + /// 본전공명 + 본전공진입시기 + 제2전공 + 제2전공진입시기 글자수 35자 넘을 때 + if (firstMajorName.count + firstMajorStart.count + secondMajorName.count + secondMajorStart.count) > 35 { + return nickname + "\n" + firstMajorName + " " + firstMajorStart + " |\n" + secondMajorName + " " + secondMajorStart + } else { + /// 본전공명 + 본전공진입시기 + 제2전공 + 제2전공진입시기 글자수 35자 넘지 않을 때 + return nickname + "\n" + firstMajorName + " " + firstMajorStart + " | " + secondMajorName + " " + secondMajorStart + } + } else { + /// 본전공명 + 본전공진입시기 + 제2전공 + 제2전공진입시기 글자수 37자 넘을 때 + if (firstMajorName.count + firstMajorStart.count + secondMajorName.count + secondMajorStart.count) > 37 { + return nickname + "\n" + firstMajorName + " " + firstMajorStart + " |\n" + secondMajorName + " " + secondMajorStart + } else { + /// 본전공명 + 본전공진입시기 + 제2전공 + 제2전공진입시기 글자수 37자 넘지 않을 때 + return nickname + "\n" + firstMajorName + " " + firstMajorStart + " | " + secondMajorName + " " + secondMajorStart + } + } + } else { + return nickname + " " + firstMajorName + " " + firstMajorStart + " | " + secondMajorName + " " + secondMajorStart + } + } +} diff --git a/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIEssentials/APIConstants.swift b/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIEssentials/APIConstants.swift index c2068afd..d9024b3f 100644 --- a/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIEssentials/APIConstants.swift +++ b/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIEssentials/APIConstants.swift @@ -9,6 +9,10 @@ import Foundation struct APIConstants { - //MARK: Base URL + // MARK: Base URL + #if DEBUG + static let baseURL = "https://asia-northeast3-nadosunbae-server-dev-90ac3.cloudfunctions.net/api" + #else static let baseURL = "https://asia-northeast3-nadosunbae-server.cloudfunctions.net/api" + #endif } diff --git a/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Classroom/Question/ClassroomQuestionDetailData.swift b/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Classroom/Question/ClassroomQuestionDetailData.swift index a753a3bf..c7e95103 100644 --- a/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Classroom/Question/ClassroomQuestionDetailData.swift +++ b/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Classroom/Question/ClassroomQuestionDetailData.swift @@ -55,11 +55,3 @@ struct ClassroomQuestionWriter: Codable { } } -func convertToMajorInfoString(_ firstMajorName: String, _ firstMajorStart: String, _ secondMajorName: String, _ secondMajorStart: String) -> String { - if secondMajorName == "미진입" { - return firstMajorName + " " + firstMajorStart + " " + "|" + " " + secondMajorName - } else { - return firstMajorName + " " + firstMajorStart + " " + "|" + " " + secondMajorName + " " + secondMajorStart - } -} - diff --git a/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Review/ReviewMainPostListData.swift b/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Review/ReviewMainPostListData.swift index e3265f2c..783b8170 100644 --- a/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Review/ReviewMainPostListData.swift +++ b/NadoSunbae-iOS/NadoSunbae-iOS/Network/APIModels/Models/Review/ReviewMainPostListData.swift @@ -6,6 +6,10 @@ // import Foundation +import UIKit + +let screenSize: CGRect = UIScreen.main.bounds +let screenWidth = screenSize.width // MARK: - ReviewMainPostListData struct ReviewMainPostListData: Codable { diff --git a/NadoSunbae-iOS/NadoSunbae-iOS/Screen/Onboarding/Cell/CVC/OnboardingCVC.xib b/NadoSunbae-iOS/NadoSunbae-iOS/Screen/Onboarding/Cell/CVC/OnboardingCVC.xib index bc8fa5b2..ea79a518 100644 --- a/NadoSunbae-iOS/NadoSunbae-iOS/Screen/Onboarding/Cell/CVC/OnboardingCVC.xib +++ b/NadoSunbae-iOS/NadoSunbae-iOS/Screen/Onboarding/Cell/CVC/OnboardingCVC.xib @@ -26,16 +26,16 @@ - +