diff --git a/.gitignore b/.gitignore index 52fe2f7..e86bb7c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,10 @@ xcuserdata/ *.dSYM.zip *.dSYM +# macOS +.DS_Store + + ## Playgrounds timeline.xctimeline playground.xcworkspace diff --git a/sopt-37th-02Seminar/AppDelegate.swift b/sopt-37th-02Seminar/AppDelegate.swift new file mode 100644 index 0000000..eff8e51 --- /dev/null +++ b/sopt-37th-02Seminar/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/18/25. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/sopt-37th-02Seminar/Assets.xcassets/AccentColor.colorset/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sopt-37th-02Seminar/Assets.xcassets/AppIcon.appiconset/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sopt-37th-02Seminar/Assets.xcassets/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sopt-37th-02Seminar/Assets.xcassets/baemin_black.colorset/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/baemin_black.colorset/Contents.json new file mode 100644 index 0000000..7d2fdfe --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/baemin_black.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "28", + "green" : "26", + "red" : "24" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sopt-37th-02Seminar/Assets.xcassets/baemin_gray.colorset/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/baemin_gray.colorset/Contents.json new file mode 100644 index 0000000..968fe67 --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/baemin_gray.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "217", + "green" : "211", + "red" : "209" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sopt-37th-02Seminar/Assets.xcassets/baemin_mint.colorset/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/baemin_mint.colorset/Contents.json new file mode 100644 index 0000000..08dae1c --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/baemin_mint.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "179", + "green" : "184", + "red" : "40" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sopt-37th-02Seminar/Assets.xcassets/eye.imageset/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/eye.imageset/Contents.json new file mode 100644 index 0000000..8db67a9 --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/eye.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "bc5dcba2291b01249564325ded57c5d060e7319d.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sopt-37th-02Seminar/Assets.xcassets/eye.imageset/bc5dcba2291b01249564325ded57c5d060e7319d.png b/sopt-37th-02Seminar/Assets.xcassets/eye.imageset/bc5dcba2291b01249564325ded57c5d060e7319d.png new file mode 100644 index 0000000..5064914 Binary files /dev/null and b/sopt-37th-02Seminar/Assets.xcassets/eye.imageset/bc5dcba2291b01249564325ded57c5d060e7319d.png differ diff --git a/sopt-37th-02Seminar/Assets.xcassets/eyeblack.imageset/3ac827455c3e6b78f2429cd4362a163ce082b13a.png b/sopt-37th-02Seminar/Assets.xcassets/eyeblack.imageset/3ac827455c3e6b78f2429cd4362a163ce082b13a.png new file mode 100644 index 0000000..96d1154 Binary files /dev/null and b/sopt-37th-02Seminar/Assets.xcassets/eyeblack.imageset/3ac827455c3e6b78f2429cd4362a163ce082b13a.png differ diff --git a/sopt-37th-02Seminar/Assets.xcassets/eyeblack.imageset/Contents.json b/sopt-37th-02Seminar/Assets.xcassets/eyeblack.imageset/Contents.json new file mode 100644 index 0000000..0cab759 --- /dev/null +++ b/sopt-37th-02Seminar/Assets.xcassets/eyeblack.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "3ac827455c3e6b78f2429cd4362a163ce082b13a.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/sopt-37th-02Seminar/Assets.xcassets/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.imageset/Contents.json" "b/sopt-37th-02Seminar/Assets.xcassets/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.imageset/Contents.json" new file mode 100644 index 0000000..c96b179 --- /dev/null +++ "b/sopt-37th-02Seminar/Assets.xcassets/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "배민 이미지.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/sopt-37th-02Seminar/Assets.xcassets/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.imageset/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.png" "b/sopt-37th-02Seminar/Assets.xcassets/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.imageset/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.png" new file mode 100644 index 0000000..d9a06db Binary files /dev/null and "b/sopt-37th-02Seminar/Assets.xcassets/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.imageset/\353\260\260\353\257\274 \354\235\264\353\257\270\354\247\200.png" differ diff --git a/sopt-37th-02Seminar/Base.lproj/LaunchScreen.storyboard b/sopt-37th-02Seminar/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/sopt-37th-02Seminar/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sopt-37th-02Seminar/Extension/UIFont.swift b/sopt-37th-02Seminar/Extension/UIFont.swift new file mode 100644 index 0000000..8bf645b --- /dev/null +++ b/sopt-37th-02Seminar/Extension/UIFont.swift @@ -0,0 +1,36 @@ +// +// UIFont.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/26/25. +// + +import Foundation +import UIKit + +enum FontName: String { + case pretendardBold = "Pretendard-Bold" + case pretendardSemiBold = "Pretendard-SemiBold" + case pretendardLight = "Pretendard-Light" + case pretendardMedium = "Pretendard-Medium" + case pretendardRegular = "Pretendard-Regular" + case pretendardExtraBold = "Pretendard-ExtraBold" +} + +extension UIFont { + static func font(_ style: FontName, ofSize size: CGFloat) -> UIFont { + guard let customFont = UIFont(name: style.rawValue, size: size) else { + return UIFont.systemFont(ofSize: size) + } + return customFont + } + + + @nonobjc class var size17: UIFont { + return UIFont.font(.pretendardSemiBold, ofSize: 17) + } + + @nonobjc class var size24: UIFont { + return UIFont.font(.pretendardExtraBold, ofSize: 24) + } +} diff --git a/sopt-37th-02Seminar/Extension/UIStackView.swift b/sopt-37th-02Seminar/Extension/UIStackView.swift new file mode 100644 index 0000000..c445149 --- /dev/null +++ b/sopt-37th-02Seminar/Extension/UIStackView.swift @@ -0,0 +1,15 @@ +// +// UIStackView.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/27/25. +// + +import Foundation +import UIKit + +extension UIStackView { + func addArrangedSubviews(_ views: UIView...) { + views.forEach { self.addArrangedSubview($0) } + } +} diff --git a/sopt-37th-02Seminar/Extension/UITextField.swift b/sopt-37th-02Seminar/Extension/UITextField.swift new file mode 100644 index 0000000..ed51617 --- /dev/null +++ b/sopt-37th-02Seminar/Extension/UITextField.swift @@ -0,0 +1,44 @@ +// +// UITextField.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/27/25. +// + +import Foundation +import UIKit + +enum TextFieldStyle: Int { + case email + case password +} + +extension UITextField { + + func placeholderFallback() { + + switch TextFieldStyle(rawValue: self.tag) { + case .email: + self.placeholder = "이메일 아이디" + case .password: + self.placeholder = "비밀번호" + default: + break + } + + } + + func addHorizontalPadding() { + + let leftPadding = UIView(frame: CGRect(x: 0, y: 0, width: 15,height: self.frame.height)) + self.leftView = leftPadding + self.leftViewMode = ViewMode.always + + let rightPadding = UIView(frame: CGRect(x: 0, y: 0, width: 15,height: self.frame.height)) + self.rightView = rightPadding + self.rightViewMode = ViewMode.always + + } + + +} diff --git a/sopt-37th-02Seminar/Extension/UIView.swift b/sopt-37th-02Seminar/Extension/UIView.swift new file mode 100644 index 0000000..9ac717e --- /dev/null +++ b/sopt-37th-02Seminar/Extension/UIView.swift @@ -0,0 +1,114 @@ +// +// UIView.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/26/25. +// + +import Foundation +import UIKit + + +extension UIView { + + func anchor(top: NSLayoutYAxisAnchor? = nil, + leading: NSLayoutXAxisAnchor? = nil, + bottom: NSLayoutYAxisAnchor? = nil, + trailing: NSLayoutXAxisAnchor? = nil, + paddingTop: CGFloat = 0, + leadingPadding: CGFloat = 0, + paddingBottom: CGFloat = 0, + trailingPadding: CGFloat = 0, + width: CGFloat? = nil, + height: CGFloat? = nil) { + + translatesAutoresizingMaskIntoConstraints = false + + if let top = top { + topAnchor.constraint(equalTo: top, constant: paddingTop).isActive = true + } + + if let leading = leading { + leadingAnchor.constraint(equalTo: leading, constant: leadingPadding).isActive = true + } + + if let bottom = bottom { + bottomAnchor.constraint(equalTo: bottom, constant: -paddingBottom).isActive = true + } + + if let trailing = trailing { + trailingAnchor.constraint(equalTo: trailing, constant: -trailingPadding).isActive = true + } + + if let width = width { + widthAnchor.constraint(equalToConstant: width).isActive = true + } + + if let height = height { + heightAnchor.constraint(equalToConstant: height).isActive = true + } + } + + // UIView 중앙에 정렬하기 + func center(inView view: UIView, yConstant: CGFloat? = 0) { + translatesAutoresizingMaskIntoConstraints = false + centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true + centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: yConstant!).isActive = true + } + + + func centerX(inView view: UIView, topAnchor: NSLayoutYAxisAnchor? = nil, paddingTop: CGFloat? = 0) { + translatesAutoresizingMaskIntoConstraints = false + centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true + + if let topAnchor = topAnchor { + self.topAnchor.constraint(equalTo: topAnchor, constant: paddingTop!).isActive = true + } + } + + func centerY(inView view: UIView, leadingAnchor: NSLayoutXAxisAnchor? = nil, + leadingPadding: CGFloat = 0, constant: CGFloat = 0) { + + translatesAutoresizingMaskIntoConstraints = false + centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: constant).isActive = true + + if let leading = leadingAnchor { + anchor(leading: leading , leadingPadding: leadingPadding) + } + } + + func setDimensions(height: CGFloat, width: CGFloat) { + translatesAutoresizingMaskIntoConstraints = false + heightAnchor.constraint(equalToConstant: height).isActive = true + widthAnchor.constraint(equalToConstant: width).isActive = true + } + + func setHeight(_ height: CGFloat) { + translatesAutoresizingMaskIntoConstraints = false + heightAnchor.constraint(equalToConstant: height).isActive = true + } + + func setWidth(_ width: CGFloat) { + translatesAutoresizingMaskIntoConstraints = false + widthAnchor.constraint(equalToConstant: width).isActive = true + } + + func fillSuperview() { + translatesAutoresizingMaskIntoConstraints = false + guard let view = superview else { return } + anchor(top: view.topAnchor, leading: view.leadingAnchor, + bottom: view.bottomAnchor, trailing: view.trailingAnchor) + } + + func fillSuperviewToSafearea() { + translatesAutoresizingMaskIntoConstraints = false + guard let view = superview else { return } + let safeArea = view.safeAreaLayoutGuide + anchor(top: safeArea.topAnchor, leading: safeArea.leadingAnchor, + bottom: safeArea.bottomAnchor, trailing: safeArea.trailingAnchor) + } + + func addSubviews(_ views: UIView...) { + views.forEach { self.addSubview($0) } + } +} diff --git a/sopt-37th-02Seminar/Extension/UIViewController.swift b/sopt-37th-02Seminar/Extension/UIViewController.swift new file mode 100644 index 0000000..0ace13e --- /dev/null +++ b/sopt-37th-02Seminar/Extension/UIViewController.swift @@ -0,0 +1,30 @@ +// +// UIViewController.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/29/25. +// + +import Foundation +import UIKit + +extension UIViewController { + func presentDynamicBottomSheet(vc: UIViewController) { + let nav = UINavigationController(rootViewController: vc) + nav.modalPresentationStyle = .pageSheet + if let sheet = nav.sheetPresentationController { + if #available(iOS 16.0, *) { + sheet.detents = [ + .custom { _ in + return vc.preferredContentSize.height + } + ] + sheet.prefersGrabberVisible = true + sheet.preferredCornerRadius = 16 + } else { + sheet.detents = [.medium(), .large()] + } + } + self.present(nav, animated: true) + } +} diff --git a/sopt-37th-02Seminar/Font/Pretendard-Bold.otf b/sopt-37th-02Seminar/Font/Pretendard-Bold.otf new file mode 100644 index 0000000..8e5e30a Binary files /dev/null and b/sopt-37th-02Seminar/Font/Pretendard-Bold.otf differ diff --git a/sopt-37th-02Seminar/Font/Pretendard-ExtraBold.otf b/sopt-37th-02Seminar/Font/Pretendard-ExtraBold.otf new file mode 100644 index 0000000..388f3ca Binary files /dev/null and b/sopt-37th-02Seminar/Font/Pretendard-ExtraBold.otf differ diff --git a/sopt-37th-02Seminar/Font/Pretendard-Light.otf b/sopt-37th-02Seminar/Font/Pretendard-Light.otf new file mode 100644 index 0000000..228679e Binary files /dev/null and b/sopt-37th-02Seminar/Font/Pretendard-Light.otf differ diff --git a/sopt-37th-02Seminar/Font/Pretendard-Medium.otf b/sopt-37th-02Seminar/Font/Pretendard-Medium.otf new file mode 100644 index 0000000..0575069 Binary files /dev/null and b/sopt-37th-02Seminar/Font/Pretendard-Medium.otf differ diff --git a/sopt-37th-02Seminar/Font/Pretendard-Regular.otf b/sopt-37th-02Seminar/Font/Pretendard-Regular.otf new file mode 100644 index 0000000..08bf4cf Binary files /dev/null and b/sopt-37th-02Seminar/Font/Pretendard-Regular.otf differ diff --git a/sopt-37th-02Seminar/Font/Pretendard-SemiBold.otf b/sopt-37th-02Seminar/Font/Pretendard-SemiBold.otf new file mode 100644 index 0000000..e7e36ab Binary files /dev/null and b/sopt-37th-02Seminar/Font/Pretendard-SemiBold.otf differ diff --git a/sopt-37th-02Seminar/Info.plist b/sopt-37th-02Seminar/Info.plist new file mode 100644 index 0000000..652ddb3 --- /dev/null +++ b/sopt-37th-02Seminar/Info.plist @@ -0,0 +1,32 @@ + + + + + UIAppFonts + + Pretendard-Bold.otf + Pretendard-ExtraBold.otf + Pretendard-Light.otf + Pretendard-Medium.otf + Pretendard-Regular.otf + Pretendard-SemiBold.otf + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + + diff --git a/sopt-37th-02Seminar/SceneDelegate.swift b/sopt-37th-02Seminar/SceneDelegate.swift new file mode 100644 index 0000000..3b1db8b --- /dev/null +++ b/sopt-37th-02Seminar/SceneDelegate.swift @@ -0,0 +1,60 @@ +// +// SceneDelegate.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/18/25. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + + // 1. + guard let windowScene = (scene as? UIWindowScene) else { return } + // 2. + let window = UIWindow(windowScene: windowScene) + // 3. + let vc = UINavigationController(rootViewController: MainViewController()) + // 4. + window.rootViewController = vc + // 5. + self.window = window + // 6. + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/sopt-37th-02Seminar/SubClassing/CustomPaddingLabel.swift b/sopt-37th-02Seminar/SubClassing/CustomPaddingLabel.swift new file mode 100644 index 0000000..239bbf8 --- /dev/null +++ b/sopt-37th-02Seminar/SubClassing/CustomPaddingLabel.swift @@ -0,0 +1,43 @@ +// +// CustomPaddingLabel.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/31/25. +// + +import Foundation +import UIKit + +class CustomPaddingLabel: UILabel { + + var topInset: CGFloat + var bottomInset: CGFloat + var leftInset: CGFloat + var rightInset: CGFloat + + required init(_ top: CGFloat, _ bottom: CGFloat, _ left: CGFloat, _ right: CGFloat) { + self.topInset = top + self.bottomInset = bottom + self.leftInset = left + self.rightInset = right + super.init(frame: CGRect.zero) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func drawText(in rect: CGRect) { + let insets = UIEdgeInsets(top: topInset, left: leftInset, bottom: bottomInset, right: rightInset) + super.drawText(in: rect.inset(by: insets)) + } + + override var intrinsicContentSize: CGSize { + get { + var contentSize = super.intrinsicContentSize + contentSize.height += topInset + bottomInset + contentSize.width += leftInset + rightInset + return contentSize + } + } +} diff --git a/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.pbxproj b/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ebc0943 --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.pbxproj @@ -0,0 +1,552 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + 1E5097D82EAE396A00DA0C45 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E5097CF2EAE396A00DA0C45 /* AppDelegate.swift */; }; + 1E5097D92EAE396A00DA0C45 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E5097D42EAE396A00DA0C45 /* SceneDelegate.swift */; }; + 1E5097DB2EAE396A00DA0C45 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1E5097D02EAE396A00DA0C45 /* Assets.xcassets */; }; + 1E5097DD2EAE396A00DA0C45 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E5097D22EAE396A00DA0C45 /* LaunchScreen.storyboard */; }; + 1E5099652EB22A4600DA0C45 /* Then in Frameworks */ = {isa = PBXBuildFile; productRef = 1E5099642EB22A4600DA0C45 /* Then */; }; + 1E6F3BA62EA38B3D007B5D26 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 1E6F3BA52EA38B3D007B5D26 /* SnapKit */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 1EC085782EC8A6E1005FCD59 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1E6F3B6F2EA35E91007B5D26 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1E6F3B762EA35E91007B5D26; + remoteInfo = "sopt-37th-02Seminar"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1E5097CF2EAE396A00DA0C45 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 1E5097D02EAE396A00DA0C45 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 1E5097D12EAE396A00DA0C45 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1E5097D42EAE396A00DA0C45 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 1E5097D72EAE396A00DA0C45 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 1E6F3B772EA35E91007B5D26 /* sopt-37th-02Seminar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "sopt-37th-02Seminar.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1EC085742EC8A6E1005FCD59 /* sopt-37th-02SeminarTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "sopt-37th-02SeminarTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 1E0A9AC32EB3CFC6005BAAE7 /* SubClassing */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = SubClassing; + sourceTree = ""; + }; + 1E5098072EAE417800DA0C45 /* sopt-37th-assignment */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "sopt-37th-assignment"; + sourceTree = ""; + }; + 1E50980C2EAE41CB00DA0C45 /* Extension */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Extension; + sourceTree = ""; + }; + 1E5098942EAE9BB500DA0C45 /* Font */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Font; + sourceTree = ""; + }; + 1EC085752EC8A6E1005FCD59 /* sopt-37th-02SeminarTests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "sopt-37th-02SeminarTests"; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1E6F3B742EA35E91007B5D26 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E6F3BA62EA38B3D007B5D26 /* SnapKit in Frameworks */, + 1E5099652EB22A4600DA0C45 /* Then in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC085712EC8A6E1005FCD59 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1E6F3B6E2EA35E91007B5D26 = { + isa = PBXGroup; + children = ( + 1E0A9AC32EB3CFC6005BAAE7 /* SubClassing */, + 1E50980C2EAE41CB00DA0C45 /* Extension */, + 1E5098072EAE417800DA0C45 /* sopt-37th-assignment */, + 1EC085752EC8A6E1005FCD59 /* sopt-37th-02SeminarTests */, + 1E6F3B782EA35E91007B5D26 /* Products */, + 1E5098942EAE9BB500DA0C45 /* Font */, + 1E5097D42EAE396A00DA0C45 /* SceneDelegate.swift */, + 1E5097CF2EAE396A00DA0C45 /* AppDelegate.swift */, + 1E5097D02EAE396A00DA0C45 /* Assets.xcassets */, + 1E5097D12EAE396A00DA0C45 /* Info.plist */, + 1E5097D22EAE396A00DA0C45 /* LaunchScreen.storyboard */, + ); + sourceTree = ""; + }; + 1E6F3B782EA35E91007B5D26 /* Products */ = { + isa = PBXGroup; + children = ( + 1E6F3B772EA35E91007B5D26 /* sopt-37th-02Seminar.app */, + 1EC085742EC8A6E1005FCD59 /* sopt-37th-02SeminarTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1E6F3B762EA35E91007B5D26 /* sopt-37th-02Seminar */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1E6F3B8A2EA35E92007B5D26 /* Build configuration list for PBXNativeTarget "sopt-37th-02Seminar" */; + buildPhases = ( + 1E6F3B732EA35E91007B5D26 /* Sources */, + 1E6F3B742EA35E91007B5D26 /* Frameworks */, + 1E6F3B752EA35E91007B5D26 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 1E0A9AC32EB3CFC6005BAAE7 /* SubClassing */, + 1E5098072EAE417800DA0C45 /* sopt-37th-assignment */, + 1E50980C2EAE41CB00DA0C45 /* Extension */, + 1E5098942EAE9BB500DA0C45 /* Font */, + ); + name = "sopt-37th-02Seminar"; + packageProductDependencies = ( + 1E6F3BA52EA38B3D007B5D26 /* SnapKit */, + 1E5099642EB22A4600DA0C45 /* Then */, + ); + productName = "sopt-37th-02Seminar"; + productReference = 1E6F3B772EA35E91007B5D26 /* sopt-37th-02Seminar.app */; + productType = "com.apple.product-type.application"; + }; + 1EC085732EC8A6E1005FCD59 /* sopt-37th-02SeminarTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1EC0857C2EC8A6E1005FCD59 /* Build configuration list for PBXNativeTarget "sopt-37th-02SeminarTests" */; + buildPhases = ( + 1EC085702EC8A6E1005FCD59 /* Sources */, + 1EC085712EC8A6E1005FCD59 /* Frameworks */, + 1EC085722EC8A6E1005FCD59 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 1EC085792EC8A6E1005FCD59 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + 1EC085752EC8A6E1005FCD59 /* sopt-37th-02SeminarTests */, + ); + name = "sopt-37th-02SeminarTests"; + packageProductDependencies = ( + ); + productName = "sopt-37th-02SeminarTests"; + productReference = 1EC085742EC8A6E1005FCD59 /* sopt-37th-02SeminarTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 1E6F3B6F2EA35E91007B5D26 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 2600; + LastUpgradeCheck = 2600; + TargetAttributes = { + 1E6F3B762EA35E91007B5D26 = { + CreatedOnToolsVersion = 26.0.1; + }; + 1EC085732EC8A6E1005FCD59 = { + CreatedOnToolsVersion = 26.0.1; + TestTargetID = 1E6F3B762EA35E91007B5D26; + }; + }; + }; + buildConfigurationList = 1E6F3B722EA35E91007B5D26 /* Build configuration list for PBXProject "sopt-37th-02Seminar" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 1E6F3B6E2EA35E91007B5D26; + minimizedProjectReferenceProxies = 1; + packageReferences = ( + 1E6F3BA42EA38B3D007B5D26 /* XCRemoteSwiftPackageReference "SnapKit" */, + 1E5099632EB22A4600DA0C45 /* XCRemoteSwiftPackageReference "Then" */, + ); + preferredProjectObjectVersion = 77; + productRefGroup = 1E6F3B782EA35E91007B5D26 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1E6F3B762EA35E91007B5D26 /* sopt-37th-02Seminar */, + 1EC085732EC8A6E1005FCD59 /* sopt-37th-02SeminarTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1E6F3B752EA35E91007B5D26 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E5097DB2EAE396A00DA0C45 /* Assets.xcassets in Resources */, + 1E5097DD2EAE396A00DA0C45 /* LaunchScreen.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC085722EC8A6E1005FCD59 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1E6F3B732EA35E91007B5D26 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E5097D82EAE396A00DA0C45 /* AppDelegate.swift in Sources */, + 1E5097D92EAE396A00DA0C45 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC085702EC8A6E1005FCD59 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 1EC085792EC8A6E1005FCD59 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1E6F3B762EA35E91007B5D26 /* sopt-37th-02Seminar */; + targetProxy = 1EC085782EC8A6E1005FCD59 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 1E5097D22EAE396A00DA0C45 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 1E5097D72EAE396A00DA0C45 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 1E6F3B8B2EA35E92007B5D26 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "come.Jin.sopt-37th-02Seminar"; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 1E6F3B8C2EA35E92007B5D26 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "come.Jin.sopt-37th-02Seminar"; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 1E6F3B8D2EA35E92007B5D26 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 1E6F3B8E2EA35E92007B5D26 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 1EC0857A2EC8A6E1005FCD59 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 5RA2A76S4S; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "come.Jin.sopt-37th-02SeminarTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRING_CATALOG_GENERATE_SYMBOLS = NO; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/sopt-37th-02Seminar.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/sopt-37th-02Seminar"; + }; + name = Debug; + }; + 1EC0857B2EC8A6E1005FCD59 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 5RA2A76S4S; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "come.Jin.sopt-37th-02SeminarTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRING_CATALOG_GENERATE_SYMBOLS = NO; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/sopt-37th-02Seminar.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/sopt-37th-02Seminar"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1E6F3B722EA35E91007B5D26 /* Build configuration list for PBXProject "sopt-37th-02Seminar" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1E6F3B8D2EA35E92007B5D26 /* Debug */, + 1E6F3B8E2EA35E92007B5D26 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1E6F3B8A2EA35E92007B5D26 /* Build configuration list for PBXNativeTarget "sopt-37th-02Seminar" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1E6F3B8B2EA35E92007B5D26 /* Debug */, + 1E6F3B8C2EA35E92007B5D26 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1EC0857C2EC8A6E1005FCD59 /* Build configuration list for PBXNativeTarget "sopt-37th-02SeminarTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1EC0857A2EC8A6E1005FCD59 /* Debug */, + 1EC0857B2EC8A6E1005FCD59 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 1E5099632EB22A4600DA0C45 /* XCRemoteSwiftPackageReference "Then" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/devxoul/Then"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 3.0.0; + }; + }; + 1E6F3BA42EA38B3D007B5D26 /* XCRemoteSwiftPackageReference "SnapKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SnapKit/SnapKit"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.7.1; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 1E5099642EB22A4600DA0C45 /* Then */ = { + isa = XCSwiftPackageProductDependency; + package = 1E5099632EB22A4600DA0C45 /* XCRemoteSwiftPackageReference "Then" */; + productName = Then; + }; + 1E6F3BA52EA38B3D007B5D26 /* SnapKit */ = { + isa = XCSwiftPackageProductDependency; + package = 1E6F3BA42EA38B3D007B5D26 /* XCRemoteSwiftPackageReference "SnapKit" */; + productName = SnapKit; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 1E6F3B6F2EA35E91007B5D26 /* Project object */; +} diff --git a/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..8063172 --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-02Seminar.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,24 @@ +{ + "originHash" : "2ad69c0deaec8838f2417eb6e8d288b30a36442bc22243bc0f5ee813f88e20a7", + "pins" : [ + { + "identity" : "snapkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SnapKit/SnapKit", + "state" : { + "revision" : "2842e6e84e82eb9a8dac0100ca90d9444b0307f4", + "version" : "5.7.1" + } + }, + { + "identity" : "then", + "kind" : "remoteSourceControl", + "location" : "https://github.com/devxoul/Then", + "state" : { + "revision" : "d41ef523faef0f911369f79c0b96815d9dbb6d7a", + "version" : "3.0.0" + } + } + ], + "version" : 3 +} diff --git a/sopt-37th-02Seminar/sopt-37th-02SeminarTests/sopt_37th_02SeminarTests.swift b/sopt-37th-02Seminar/sopt-37th-02SeminarTests/sopt_37th_02SeminarTests.swift new file mode 100644 index 0000000..6299698 --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-02SeminarTests/sopt_37th_02SeminarTests.swift @@ -0,0 +1,95 @@ +// +// sopt_37th_02SeminarTests.swift +// sopt-37th-02SeminarTests +// +// Created by JIN on 11/15/25. +// + +import XCTest +@testable import sopt_37th_02Seminar + +final class sopt_37th_02SeminarTests: XCTestCase { + + var sut: LoginValidator! + + override func setUpWithError() throws { + try super.setUpWithError() + sut = LoginValidator() + } + + override func tearDownWithError() throws { + try super.tearDownWithError() + } + + // MARK: - Login Validation Tests + + func test_isValidEmail_ValidEmailProvided_ReturnsTrue() throws { + // Given + let validEmails = [ + "test@example.com", + "user.name@domain.co.kr", + "user+tag@example.com", + "test123@test-domain.com" + ] + + // When & Then + for email in validEmails { + let result = sut.isValidEmail(email) + XCTAssertTrue(result, "Expected '\(email)' to be valid") + } + } + + func test_isValidEmail_InvalidEmailProvided_ReturnsFalse() throws { + // Given + let invalidEmails = [ + "notanemail", + "@example.com", + "user@", + "user@domain", + "user name@example.com", + "", + nil + ] + + // When & Then + for email in invalidEmails { + let result = sut.isValidEmail(email) + XCTAssertFalse(result, "Expected '\(email ?? "nil")' to be invalid") + } + } + + func test_isValidPassword_ValidPasswordProvided_ReturnsTrue() throws { + // Given + let validPasswords = [ + "Test1234!", + "MyP@ssw0rd", + "SecurePass123#", + "Abcd123!@#" + ] + + // When & Then + for password in validPasswords { + let result = sut.isValidPassword(password) + XCTAssertTrue(result, "Expected '\(password)' to be valid (must contain letters, numbers, special chars, and be 8+ chars)") + } + } + + func test_isValidPassword_InvalidPasswordProvided_ReturnsFalse() throws { + // Given + let invalidPasswords = [ + "short1!", //8자리 이하 + "NoNumbers!", //숫자없음 + "NoSpecial123", //특수문자없음 + "12345678!", //글자없음 + "", //빈값 + nil //nil 값 + ] + + // When & Then + for password in invalidPasswords { + let result = sut.isValidPassword(password) + XCTAssertFalse(result, "Expected '\(password ?? "nil")' to be invalid") + } + } +} + diff --git a/sopt-37th-02Seminar/sopt-37th-assignment/BottomSheetViewController.swift b/sopt-37th-02Seminar/sopt-37th-assignment/BottomSheetViewController.swift new file mode 100644 index 0000000..76de7e8 --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-assignment/BottomSheetViewController.swift @@ -0,0 +1,90 @@ +// +// BottomSheetViewController.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/29/25. +// + +import UIKit +import SnapKit +import Then + +class BottomSheetViewController: UIViewController { + + weak var delegate: BottomSheetDelegate? + + private let infoLabel = UILabel().then { + $0.text = "이메일을 입력해주세요" + $0.font = .systemFont(ofSize: 17, weight: .medium) + $0.textColor = .black + } + + private let emailTextField = UITextField().then { + $0.placeholder = "이메일" + $0.backgroundColor = .white + $0.layer.cornerRadius = 5 + $0.layer.borderWidth = 1 + $0.layer.borderColor = UIColor.systemGray4.cgColor + $0.addHorizontalPadding() + } + + private lazy var enterButton = UIButton(type: .system).then { + $0.setTitle("확인", for: .normal) + $0.titleLabel?.font = .systemFont(ofSize: 17, weight: .bold) + $0.backgroundColor = UIColor(named: "baemin_mint") + $0.setTitleColor(.white, for: .normal) + $0.layer.cornerRadius = 5 + $0.addTarget(self, action: #selector(enterButtonTapped), for: .touchUpInside) + } + + // MARK: - Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .systemGray4 + addLayout() + } + + @objc + private func enterButtonTapped() { + guard let newEmailId = emailTextField.text else { return } + delegate?.showNewEmail(newEmailId) + dismiss(animated: true) + } + +} + +// MARK: - Layout + +extension BottomSheetViewController { + + func addLayout() { + view.addSubviews(infoLabel, emailTextField, enterButton) + + infoLabel.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide).offset(68) + $0.leading.equalTo(view.safeAreaLayoutGuide).offset(17) + } + + emailTextField.snp.makeConstraints { + $0.top.equalTo(infoLabel.snp.bottom).offset(20) + $0.leading.equalTo(view.safeAreaLayoutGuide).offset(17) + $0.width.equalTo(343) + $0.height.equalTo(46) + } + + enterButton.snp.makeConstraints { + $0.top.equalTo(emailTextField.snp.bottom).offset(135) + $0.leading.equalTo(view.safeAreaLayoutGuide).offset(17) + $0.trailing.equalTo(view.safeAreaLayoutGuide).offset(-17) + $0.width.equalTo(343) + $0.height.equalTo(46) + } + } + +} + + +#Preview { + BottomSheetViewController() +} diff --git a/sopt-37th-02Seminar/sopt-37th-assignment/LoginValidator.swift b/sopt-37th-02Seminar/sopt-37th-assignment/LoginValidator.swift new file mode 100644 index 0000000..fe627df --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-assignment/LoginValidator.swift @@ -0,0 +1,30 @@ +// +// LoginValidator.swift +// sopt-37th-02Seminar +// +// Created by JIN on 11/15/25. +// + +import Foundation + +class LoginValidator { + + // MARK: - Properties + + private let emailRegex = "^[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$" + private let passwordRegex = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]).{8,}$" + + // MARK: - Validation Methods + + func isValidEmail(_ string: String?) -> Bool { + guard let string = string else { return false } + + return string.range(of: self.emailRegex, options: .regularExpression) != nil + } + + func isValidPassword(_ string: String?) -> Bool { + guard let string = string else { return false } + + return string.range(of: self.passwordRegex, options: .regularExpression) != nil + } +} diff --git a/sopt-37th-02Seminar/sopt-37th-assignment/MainViewController.swift b/sopt-37th-02Seminar/sopt-37th-assignment/MainViewController.swift new file mode 100644 index 0000000..69cbbdb --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-assignment/MainViewController.swift @@ -0,0 +1,410 @@ +// +// MainViewController.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/26/25. +// + +import UIKit + +protocol BottomSheetDelegate: AnyObject { + func showNewEmail(_ email: String) +} + +class MainViewController: UIViewController { + + // MARK: - Properties + + private let validator = LoginValidator() + + private lazy var tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleResetIdTapped)) + + private var titleLabel: UILabel = { + let label = UILabel() + label.text = "이메일 또는 아이디로 계속" + label.font = .size17 + return label + }() + + private var newEmailLabel: UILabel = { + let label = UILabel() + label.text = "" + label.font = .size17 + return label + }() + + private let emailInfoLabel: UILabel = { + let label = CustomPaddingLabel(0, 0, 3, 3) + label.text = "이메일 아이디" + label.font = .systemFont(ofSize: 13) + label.textColor = .lightGray + label.backgroundColor = .white + label.isHidden = true + return label + }() + + private let passwordInfoLabel: UILabel = { + let label = CustomPaddingLabel(0, 0, 3, 3) + label.text = "비밀번호" + label.font = .systemFont(ofSize: 13) + label.textColor = .lightGray + label.backgroundColor = .white + label.isHidden = true + return label + }() + + private lazy var emailTextFieldView: UIView = { + let view = UIView() + view.layer.cornerRadius = 8 + view.clipsToBounds = false + view.addSubviews(emailTextField, emailInfoLabel, cleanEmailTextFieldButton) + return view + }() + + private lazy var emailTextField: UITextField = { + let textField = UITextField() + textField.keyboardType = UIKeyboardType.emailAddress + textField.placeholder = "이메일 아이디" + textField.clearButtonMode = .whileEditing + textField.delegate = self + textField.tag = TextFieldStyle.email.rawValue + textField.addHorizontalPadding() + textField.autocapitalizationType = .none + return textField + }() + + private lazy var passwordTextFieldView: UIView = { + let view = UIView() + view.layer.cornerRadius = 8 + view.clipsToBounds = false + view.addSubviews(passwordTextField,passwordInfoLabel,cleanPasswordTextFieldButton,securityToggleButton) + return view + }() + + private lazy var passwordTextField: UITextField = { + let textField = UITextField() + textField.placeholder = "비밀번호" + textField.delegate = self + textField.clearButtonMode = .whileEditing + textField.isSecureTextEntry = true + textField.tag = TextFieldStyle.password.rawValue + textField.addHorizontalPadding() + textField.autocapitalizationType = .none + return textField + }() + + private lazy var securityToggleButton: UIButton = { + let button = UIButton() + button.isHidden = true + button.setImage(UIImage(named: "eyeblack"), for: .normal) + button.addTarget(self, action: #selector(handleSecurityToggleButtonTapped), for: .touchUpInside) + button.anchor(width: 24, height: 24) + return button + }() + + private lazy var cleanEmailTextFieldButton: UIButton = { + let button = UIButton() + button.isHidden = true + button.setImage(UIImage(systemName: "x.circle.fill"), for: .normal) + button.addTarget(self, action: #selector(cleanEmailButtonTapped), for: .touchUpInside) + button.tintColor = UIColor(named: "baemin_gray") + button.anchor(width: 20, height: 20) + return button + }() + + private lazy var cleanPasswordTextFieldButton: UIButton = { + let button = UIButton() + button.isHidden = true + button.setImage(UIImage(systemName: "x.circle.fill"), for: .normal) + button.addTarget(self, action: #selector(cleanPasswordButtonTapped), for: .touchUpInside) + button.tintColor = UIColor(named: "baemin_gray") + button.anchor(width: 20, height: 20) + return button + }() + + private lazy var LoginStackView: UIStackView = { + let stackView = UIStackView() + stackView.addArrangedSubviews(emailTextFieldView, passwordTextFieldView, loginButton) + stackView.spacing = 6 + stackView.axis = .vertical + stackView.distribution = .fillEqually + stackView.alignment = .fill + return stackView + }() + + private lazy var loginButton: UIButton = { + let button = UIButton(type: .system) + button.setTitle("로그인", for: .normal) + button.titleLabel?.font = .size17 + button.setTitleColor(.white, for: .normal) + button.backgroundColor = UIColor(named: "baemin_gray") + button.layer.cornerRadius = 5 + button.addTarget(self, action: #selector(handleLoginButtonTapped), for: .touchUpInside) + return button + }() + + private let resetIdLabel: UILabel = { + let label = UILabel() + label.text = "계정찾기" + label.textColor = UIColor(named: "baemin_gray") + return label + }() + + private let resetIdImage: UIImageView = { + let icon = UIImageView() + icon.image = UIImage(systemName: "chevron.right") + return icon + }() + + private lazy var resetIdTap: UIStackView = { + let view = UIStackView() + view.addArrangedSubviews(resetIdLabel, resetIdImage) + view.axis = .horizontal + view.spacing = 4 + view.tintColor = UIColor(named: "baemin_gray") + return view + }() + + + //MARK: - LifeCycle + + override func viewDidLoad() { + super.viewDidLoad() + addLayout() + setupTapGesture() + } + + override func viewWillAppear(_ animated: Bool) { + emailTextField.text = "" + passwordTextField.text = "" + } + + // MARK: - ActionMethod + + @objc + private func handleResetIdTapped() { + let viewControllerToPresent = BottomSheetViewController() // + viewControllerToPresent.delegate = self + if let sheet = viewControllerToPresent.sheetPresentationController { + if #available(iOS 16.0, *) { + sheet.detents = [ + .custom { _ in 400 } + ] + }else { + sheet.detents = [.medium()] + } + + sheet.prefersGrabberVisible = true + sheet.preferredCornerRadius = 16 + sheet.largestUndimmedDetentIdentifier = nil + sheet.prefersScrollingExpandsWhenScrolledToEdge = false + sheet.prefersEdgeAttachedInCompactHeight = true + sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = true + } + + present(viewControllerToPresent, animated: true) + } + + @objc + private func handleLoginButtonTapped() { + + let isEmailValid = validator.isValidEmail(emailTextField.text) + let isPasswordValid = validator.isValidPassword(passwordTextField.text) + + if !isEmailValid { + if !isPasswordValid { + checkIsFormValid(message: "이메일과 비밀번호를 다시 입력하세요", title: "로그인 형식이 잘못되었습니다") + return + } + } + + if !isEmailValid { + checkIsFormValid(message: "이메일을 다시 입력하세요", title: "이메일 형식이 달라요") + return + } + + if !isPasswordValid { + checkIsFormValid(message: "비밀번호를 다시 입력하세요", title: "비밀번호 형식이 달라요") + return + } + + + pushToWelcomeVC() + } + + + @objc + private func handleSecurityToggleButtonTapped() { + passwordTextField.isSecureTextEntry.toggle() + let imageName = passwordTextField.isSecureTextEntry ? "eyeblack" : "eye" + securityToggleButton.setImage(UIImage(named: imageName), for: .normal) + } + + @objc + private func cleanEmailButtonTapped() { + emailTextField.text = "" + } + + @objc + private func cleanPasswordButtonTapped() { + passwordTextField.text = "" + } + + + //MARK: Method + + private func pushToWelcomeVC() { + let welcomeViewController = WelcomeViewController() + welcomeViewController.name = emailTextField.text + welcomeViewController.navigationItem.title = "대체 뼈찜 누가 시켰어" + view.endEditing(true) + self.navigationController?.pushViewController(welcomeViewController, animated: true) + } + + + private func updateLoginButtonState(isEnabled: Bool, backgroundColor: UIColor?) { + loginButton.isEnabled = isEnabled + loginButton.backgroundColor = backgroundColor + } + + private func checkIsFormValid(message: String, title: String) { + + let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) + + let yesAction = UIAlertAction(title: "확인", style: .default) { _ in + } + alertController.addAction(yesAction) + present(alertController, animated: true) + return + } + + private func setupTapGesture() { + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleResetIdTapped)) + resetIdTap.addGestureRecognizer(tapGesture) + } + +} + + +// MARK: - textFieldDelegate + +extension MainViewController: UITextFieldDelegate { + + func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { + textField.layer.cornerRadius = 8 + textField.layer.borderColor = UIColor(named: "baemin_black")?.cgColor + textField.layer.borderWidth = 2 + + if textField == emailTextField { + cleanEmailTextFieldButton.isHidden = false + emailTextField.placeholder = "이메일 또는 아이디를 입력해주세요" + emailInfoLabel.isHidden = false + } + if textField == passwordTextField { + cleanPasswordTextFieldButton.isHidden = false + securityToggleButton.isHidden = false + passwordTextField.placeholder = "비밀번호를 입력해주세요" + passwordInfoLabel.isHidden = false + } + + return true + } + + func textFieldDidEndEditing(_ textField: UITextField) { + textField.layer.borderColor = UIColor(named: "baemin_gray")?.cgColor + textField.layer.borderWidth = 1 + textField.placeholderFallback() + if textField == emailTextField { + cleanEmailTextFieldButton.isHidden = true + emailInfoLabel.isHidden = true + } + if textField == passwordTextField { + cleanPasswordTextFieldButton.isHidden = true + securityToggleButton.isHidden = true + passwordInfoLabel.isHidden = true + } + } + + + func textFieldDidChangeSelection(_ textField: UITextField) { + + let isEmpty = (emailTextField.text?.isEmpty ?? true ) || (passwordTextField.text?.isEmpty ?? true) + if !isEmpty { + updateLoginButtonState(isEnabled: true, backgroundColor: UIColor(named: "baemin_mint")) + } else { + updateLoginButtonState(isEnabled: false, backgroundColor: UIColor(named: "baemin_gray")) + } + + } + + + + // 엔터를 누르면 키보드 숨기는 코드 + + func textFieldShouldReturn(_ textField: UITextField) -> Bool { + // 두개의 텍스트필드를 모두 종료 (키보드 내려가기) + if emailTextField.text != "", passwordTextField.text != "" { + passwordTextField.resignFirstResponder() + return true + // 두번째 텍스트필드로 넘어가도록 + } else if emailTextField.text != "" { + passwordTextField.becomeFirstResponder() + return true + } + return false + + } + + //화면을 터치했을 때 키보드를 안보이게 하는 코드 + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + emailTextField.resignFirstResponder() + passwordTextField.resignFirstResponder() + } + +} + + +// MARK: - UI & Layout + +extension MainViewController { + + func addLayout() { + view.backgroundColor = .white + view.addSubviews(titleLabel, LoginStackView, resetIdTap, newEmailLabel, resetIdTap) + setLabel() + setStackView() + setButton() + } + + func setLabel() { + titleLabel.centerX(inView: view, topAnchor: view.topAnchor, paddingTop: 60) + titleLabel.anchor(height: 42) + newEmailLabel.centerX(inView: view, topAnchor: resetIdTap.bottomAnchor, paddingTop: 55) + emailInfoLabel.anchor(leading: emailTextFieldView.leadingAnchor, bottom: emailTextFieldView.bottomAnchor, leadingPadding: 15, paddingBottom: 38) + passwordInfoLabel.anchor(leading: passwordTextFieldView.leadingAnchor, bottom: passwordTextFieldView.bottomAnchor, leadingPadding: 15, paddingBottom: 38) + } + + func setStackView() { + LoginStackView.centerX(inView: view, topAnchor: titleLabel.bottomAnchor, paddingTop: 30) + LoginStackView.anchor(width: 343, height: 46 * 3 + 30) + emailTextField.anchor(top: emailTextFieldView.topAnchor, leading: emailTextFieldView.leadingAnchor, bottom: emailTextFieldView.bottomAnchor, trailing: emailTextFieldView.trailingAnchor, paddingTop: 5, paddingBottom: 5) + passwordTextField.anchor(top: passwordTextFieldView.topAnchor, leading: passwordTextFieldView.leadingAnchor, bottom: passwordTextFieldView.bottomAnchor, trailing: passwordTextFieldView.trailingAnchor, paddingTop: 5, paddingBottom: 5) + } + + func setButton() { + securityToggleButton.anchor(trailing: passwordTextField.trailingAnchor, trailingPadding: 20) + securityToggleButton.centerY(inView: passwordTextFieldView) + cleanEmailTextFieldButton.centerY(inView: emailTextField) + cleanPasswordTextFieldButton.centerY(inView: passwordTextField) + cleanEmailTextFieldButton.anchor(trailing: emailTextField.trailingAnchor, trailingPadding: 20) + cleanPasswordTextFieldButton.anchor(trailing: securityToggleButton.leadingAnchor, trailingPadding: 10) + resetIdTap.centerX(inView: view, topAnchor: loginButton.bottomAnchor, paddingTop: 50) + } +} + + +extension MainViewController: BottomSheetDelegate { + func showNewEmail(_ email: String) { + newEmailLabel.text = email + } +} diff --git a/sopt-37th-02Seminar/sopt-37th-assignment/WelcomeViewController.swift b/sopt-37th-02Seminar/sopt-37th-assignment/WelcomeViewController.swift new file mode 100644 index 0000000..0521f81 --- /dev/null +++ b/sopt-37th-02Seminar/sopt-37th-assignment/WelcomeViewController.swift @@ -0,0 +1,103 @@ +// +// WelcomeViewController.swift +// sopt-37th-02Seminar +// +// Created by JIN on 10/26/25. +// + +import UIKit + +class WelcomeViewController: UIViewController { + + // MARK: - Properties + + + var name: String? + + private let welcomeLabel: UILabel = { + let label = UILabel() + label.text = "환영합니다" + label.font = .size17 + return label + }() + + private let welcomeNewMember: UILabel = { + let label = UILabel() + label.text = "반가워요" + label.font = .size24 + label.textAlignment = .center + return label + }() + + private let baeminImage: UIImageView = { + let imageView = UIImageView() + imageView.image = UIImage(named: "배민 이미지") + imageView.contentMode = .scaleAspectFill + return imageView + }() + + private lazy var backButton: UIButton = { + let button = UIButton(type: .system) + button.setTitle("뒤로가기", for: .normal) + button.titleLabel?.font = .size17 + button.setTitleColor(.white, for: .normal) + button.backgroundColor = UIColor(named: "baemin_mint") + button.layer.cornerRadius = 5 + button.addTarget(self, action: #selector(handleBackButtonTapped), for: .touchUpInside) + return button + }() + + //MARK: - LifeCycle + + override func viewDidLoad() { + super.viewDidLoad() + addLayout() + } + + // MARK: - Action + + @objc + private func handleBackButtonTapped() { + self.navigationController?.popViewController(animated: true) + } + + private func bindID() { + guard let name = name else { return } + self.welcomeLabel.text = "\(name.isEmpty ? "회원" : name)님 반가워요!" + } + + +} + +// MARK: - UI & Layout + +extension WelcomeViewController { + func addLayout() { + bindID() + view.backgroundColor = .white + view.addSubviews(baeminImage, backButton, welcomeLabel) + setImage() + setBUtton() + setLabel() + } + + func setImage() { + + baeminImage.centerX(inView: view, topAnchor: view.topAnchor, paddingTop: 120) + baeminImage.setDimensions(height:211 , width: UIScreen.main.bounds.width) + } + + func setBUtton() { + backButton.centerX(inView: view, topAnchor: baeminImage.bottomAnchor, paddingTop: 40) + backButton.setDimensions(height: 46, width: 343) + } + + + func setLabel() { + welcomeLabel.centerX(inView: view, topAnchor: backButton.bottomAnchor, paddingTop: 40) + } +} + + + +