Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ATSOPT_practice/ATSOPT_practice.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
CB861F422DA0E5CE006B15B1 /* Exceptions for "ATSOPT_practice" folder in "ATSOPT_practice" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Info.plist,
Resource/Info.plist,
);
target = CB861F2F2DA0E5CD006B15B1 /* ATSOPT_practice */;
};
Expand Down Expand Up @@ -147,7 +147,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L9J3VF6GK2;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ATSOPT_practice/Info.plist;
INFOPLIST_FILE = ATSOPT_practice/Resource/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
Expand Down Expand Up @@ -178,7 +178,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L9J3VF6GK2;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ATSOPT_practice/Info.plist;
INFOPLIST_FILE = ATSOPT_practice/Resource/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "8FAFD939-3888-4704-86C8-53D1B18BD807"
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let windowScene = (scene as? UIWindowScene) else { return }

let loginViewController = UIScrollViewViewController()
let navigationController = UINavigationController(rootViewController: loginViewController) // 네비게이션 컨트롤러 추가

let window = UIWindow(windowScene: windowScene)
window.rootViewController = ViewController()
window.rootViewController = navigationController
window.makeKeyAndVisible()
self.window = window
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "15",
"green" : "111",
"red" : "255"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "227",
"green" : "222",
"red" : "221"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "185",
"green" : "176",
"red" : "172"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "156",
"green" : "156",
"red" : "156"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "98",
"green" : "98",
"red" : "98"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "image 52.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image 52@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "image 52@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions ATSOPT_practice/ATSOPT_practice/Resource/Extension/UIFont+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// UIFont+.swift
// ATSOPT_practice
//
// Created by 최주리 on 4/5/25.
//

import UIKit

enum FontName: String {
case pretendardBlack = "Pretendard-Black"
case pretendardBold = "Pretendard-Bold"
case pretendardExtraBold = "Pretendard-ExtraBold"
case pretendardExtraLight = "Pretendard-ExtraLight"
case pretendardLight = "Pretendard-Light"
case pretendardMedium = "Pretendard-Medium"
case pretendardRegular = "Pretendard-Regular"
case pretendardSemiBold = "Pretendard-SemiBold"
case pretendardThin = "Pretendard-Thin"
}

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
}


class var head1: UIFont {
return UIFont.font(.pretendardBold, ofSize: 25)
}

@nonobjc class var subhead1: UIFont {
return UIFont.font(.pretendardBold, ofSize: 18)
}

@nonobjc class var subhead2: UIFont {
return UIFont.font(.pretendardRegular, ofSize: 16)
}

@nonobjc class var subhead3: UIFont {
return UIFont.font(.pretendardBold, ofSize: 15)
}

@nonobjc class var subhead4: UIFont {
return UIFont.font(.pretendardBold, ofSize: 14)
}

@nonobjc class var subhead5: UIFont {
return UIFont.font(.pretendardRegular, ofSize: 14)
}

@nonobjc class var info12: UIFont {
return UIFont.font(.pretendardRegular, ofSize: 12)
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Black.otf</string>
<string>Pretendard-Bold.otf</string>
<string>Pretendard-ExtraBold.otf</string>
<string>Pretendard-ExtraLight.otf</string>
<string>Pretendard-Light.otf</string>
<string>Pretendard-Medium.otf</string>
<string>Pretendard-Regular.otf</string>
<string>Pretendard-SemiBold.otf</string>
<string>Pretendard-Thin.otf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down
88 changes: 88 additions & 0 deletions ATSOPT_practice/ATSOPT_practice/View/LoginViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//
// LoginViewController.swift
// ATSOPT_practice
//
// Created by 최주리 on 4/5/25.
//

import UIKit

final class LoginViewController: UIViewController {

private let titleLabel: UILabel = {
let label = UILabel(frame: CGRect(x: 75, y: 161, width: 250, height: 44))
label.text = "동네라서 가능한 모든 것\n당근에서 가까운 이웃과 함께해요."
label.textColor = .black
label.textAlignment = .center
label.numberOfLines = 2
label.font = .subhead1
return label
}()


private let idTextField: UITextField = {
let textField = UITextField(frame: CGRect(x: 35, y: 276, width: 335, height: 52))
textField.placeholder = " 아이디"
textField.font = .info12
textField.backgroundColor = .gray200
return textField
}()

private let passwordTextField: UITextField = {
let textField = UITextField(frame: CGRect(x: 35, y: 335, width: 335, height: 52))
textField.placeholder = " 비밀번호"
textField.font = .info12
textField.isSecureTextEntry = true
textField.backgroundColor = .gray200
return textField
}()

private lazy var loginButton: UIButton = {
let button = UIButton(frame: CGRect(x: 35, y: 422, width: 332, height: 58))
button.backgroundColor = .accent
button.setTitle("로그인하기", for: .normal)
button.setTitleColor(.white, for: .normal)
button.titleLabel?.font = .subhead1
button.addTarget(self, action: #selector(loginButtonDidTapped), for: .touchUpInside)
return button
}()

override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white

setLayout()
}

private func setLayout() {
[titleLabel, idTextField, passwordTextField, loginButton].forEach {
self.view.addSubview($0)
}
}

@objc
private func loginButtonDidTapped() {
pushToWelcomeVC()
}

private func presentToWelcomeVC() {
let welcomeViewController = WelcomeViewController()
welcomeViewController.modalPresentationStyle = .formSheet
welcomeViewController.setLabelText(id: idTextField.text)
self.present(welcomeViewController, animated: true)
}

private func pushToWelcomeVC() {
let welcomeViewController = WelcomeViewController()
welcomeViewController.navigationItem.hidesBackButton = true
welcomeViewController.setLabelText(id: idTextField.text)
self.navigationController?.pushViewController(welcomeViewController, animated: true)
}
}

#Preview(traits: .portrait, body: {
let navigationController = UINavigationController(rootViewController: LoginViewController())
navigationController
})


33 changes: 33 additions & 0 deletions ATSOPT_practice/ATSOPT_practice/View/ViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// ViewController.swift
// ATSOPT_practice
//
// Created by 최주리 on 4/5/25.
//

import UIKit

class ViewController: UIViewController {

private var testView: UIView = UIView(
frame: .init(origin: .init(x: 0, y: 0),
size: .init(width: 410,height: 100)
)
)

override func viewDidLoad() {
super.viewDidLoad()

self.view.backgroundColor = .white

self.view.addSubview(testView)
}


}

#Preview(traits: .defaultLayout, body: {
ViewController()
})


Loading