Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

일단 커밋 #11

Open
wants to merge 5 commits into
base: 1-Login_SignUp_UI
Choose a base branch
from
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x8D",
"green" : "0x8D",
"red" : "0x8D"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x8D",
"green" : "0x8D",
"red" : "0x8D"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
121 changes: 121 additions & 0 deletions 10_CMD_iOS/10_CMD_iOS/LoginViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import UIKit
import SnapKit
import Then


class LoginViewController: UIViewController {

let mainLabel = UILabel() .then{
$0.textColor = .black
$0.text = "로그인"
$0.font = UIFont.systemFont(ofSize:50, weight: .bold)
}

let subLabel = UILabel() .then{
$0.textColor = .textField
$0.text = "기존 계정으로 로그인 하세요~"
$0.font = UIFont.systemFont(ofSize:16, weight: .thin)
}

let idTextField = UITextField() .then{
$0.placeholder = "아이디"
$0.textColor = .black
$0.font = UIFont.systemFont(ofSize: 20, weight: .regular)
$0.layer.borderColor = UIColor.textField.cgColor
$0.layer.borderWidth = 1
$0.layer.cornerRadius = 18
$0.addLeftPadding()
}

let passWordTextField = UITextField().then{
$0.placeholder = "비밀번호"
$0.textColor = .black
$0.font = UIFont.systemFont(ofSize: 20, weight: .regular)
$0.layer.cornerRadius = 18
$0.layer.borderColor = UIColor.textField.cgColor
$0.layer.borderWidth = 1
$0.isSecureTextEntry = true
$0.addLeftPadding()
}

let loginButton = UIButton() .then{
$0.setTitle("로그인", for: .normal)
$0.layer.cornerRadius = 18
$0.backgroundColor = .textField
$0.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .regular)
$0.setTitleColor(.black, for: .normal)
}

let signUpButton = UIButton() .then{
$0.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .regular)
$0.setTitle("회원가입 하기", for: .normal)
$0.setTitleColor(.textField, for: .normal)
$0.addTarget(nil, action: #selector(signUpButtonTap), for: .touchUpInside)
}

@objc func signUpButtonTap() {
let nextView = SignUpViewController()
self.navigationController?.pushViewController(nextView, animated: true)
}


override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .white
view.addSubview(mainLabel)
view.addSubview(subLabel)
view.addSubview(idTextField)
view.addSubview(passWordTextField)
view.addSubview(loginButton)
view.addSubview(signUpButton)



mainLabel.snp.makeConstraints{
$0.top.equalToSuperview().inset(180)
$0.left.equalToSuperview().inset(43)
}

subLabel.snp.makeConstraints{
$0.top.equalTo(mainLabel.snp.bottom).offset(15)
$0.left.equalToSuperview().inset(48)
}

idTextField.snp.makeConstraints{
$0.top.equalTo(mainLabel.snp.bottom).offset(100)
$0.left.equalToSuperview().inset(38)
$0.right.equalToSuperview().inset(36)
$0.height.equalTo(55)
}

passWordTextField.snp.makeConstraints{
$0.top.equalTo(idTextField.snp.bottom).offset(27)
$0.left.equalToSuperview().inset(38)
$0.right.equalToSuperview().inset(36)
$0.height.equalTo(55)
}

loginButton.snp.makeConstraints{
$0.top.equalTo(passWordTextField.snp.bottom).offset(100)
$0.left.equalToSuperview().inset(44)
$0.right.equalToSuperview().inset(44)
$0.height.equalTo(55)
}

signUpButton.snp.makeConstraints{
$0.top.equalTo(loginButton.snp.bottom).offset(48)
$0.centerX.equalToSuperview()
}
}


}

extension UITextField {
func addLeftPadding() {
let paddingView = UIView(frame: CGRect(x: 0, y: 0, width: 22, height: self.frame.height))
self.leftView = paddingView
self.leftViewMode = ViewMode.always
}
}
4 changes: 2 additions & 2 deletions 10_CMD_iOS/10_CMD_iOS/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let scene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: scene)
let viewController = ViewController()
window?.rootViewController = viewController
let loginViewController = LoginViewController()
window?.rootViewController = UINavigationController(rootViewController: loginViewController)
window?.makeKeyAndVisible()
}

Expand Down
148 changes: 148 additions & 0 deletions 10_CMD_iOS/10_CMD_iOS/SignUpViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import Then
import SnapKit
import UIKit

class SignUpViewController: UIViewController{

let mainLabel = UILabel() .then{
$0.textColor = .black
$0.text = "회원가입"
$0.font = UIFont.systemFont(ofSize:50, weight: .bold)
}

let subLabel = UILabel() .then{
$0.textColor = .textField
$0.text = "새로운 계정을 만들어요~"
$0.font = UIFont.systemFont(ofSize:16, weight: .thin)
}

let idTextField = UITextField() .then{
$0.placeholder = "아이디"
$0.textColor = .black
$0.font = UIFont.systemFont(ofSize: 20, weight: .regular)
$0.layer.borderColor = UIColor.textField.cgColor
$0.layer.borderWidth = 1
$0.layer.cornerRadius = 18
$0.addLeftPadding()
}

let passWordTextField = UITextField() .then{
$0.placeholder = "비밀번호"
$0.textColor = .black
$0.font = UIFont.systemFont(ofSize: 20, weight: .regular)
$0.layer.cornerRadius = 18
$0.layer.borderColor = UIColor.textField.cgColor
$0.layer.borderWidth = 1
$0.isSecureTextEntry = true
$0.addLeftPadding()
}

let checkPassWordTextField = UITextField() .then{
$0.placeholder = "비밀번호 확인"
$0.textColor = .black
$0.font = UIFont.systemFont(ofSize: 20, weight: .regular)
$0.layer.cornerRadius = 18
$0.layer.borderColor = UIColor.textField.cgColor
$0.layer.borderWidth = 1
$0.isSecureTextEntry = true
$0.addLeftPadding()
}

let checkTextField = UITextField() .then{
$0.placeholder = "인증 번호를 입력해주세요."
$0.textColor = .black
$0.font = UIFont.systemFont(ofSize: 20, weight: .regular)
$0.layer.cornerRadius = 18
$0.layer.borderColor = UIColor.textField.cgColor
$0.layer.borderWidth = 1
$0.addLeftPadding()
}

let signUpButton = UIButton() .then{
$0.setTitle("회원가입", for: .normal)
$0.layer.cornerRadius = 18
$0.backgroundColor = .textField
$0.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .regular)
$0.setTitleColor(.black, for: .normal)
}

let loginButton = UIButton() .then{
$0.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .regular)
$0.setTitle("로그인 하기", for: .normal)
$0.setTitleColor(.textField, for: .normal)
$0.addTarget(nil, action: #selector(loginButtonTap), for: .touchUpInside)
}

@objc func loginButtonTap() {
let beforeView = LoginViewController()
self.navigationController?.popViewController(animated: true)
}


override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .white
view.addSubview(mainLabel)
view.addSubview(subLabel)
view.addSubview(idTextField)
view.addSubview(passWordTextField)
view.addSubview(signUpButton)
view.addSubview(loginButton)
view.addSubview(checkTextField)
view.addSubview(checkPassWordTextField)


mainLabel.snp.makeConstraints{
$0.top.equalToSuperview().inset(136)
$0.left.equalToSuperview().inset(43)
}

subLabel.snp.makeConstraints{
$0.top.equalTo(mainLabel.snp.bottom).offset(15)
$0.left.equalToSuperview().inset(48)
}

idTextField.snp.makeConstraints{
$0.top.equalTo(mainLabel.snp.bottom).offset(80)
$0.left.equalToSuperview().inset(38)
$0.right.equalToSuperview().inset(36)
$0.height.equalTo(55)
}

passWordTextField.snp.makeConstraints{
$0.top.equalTo(idTextField.snp.bottom).offset(25)
$0.left.equalToSuperview().inset(38)
$0.right.equalToSuperview().inset(36)
$0.height.equalTo(55)
}

checkPassWordTextField.snp.makeConstraints{
$0.top.equalTo(passWordTextField.snp.bottom).offset(25)
$0.left.equalToSuperview().inset(38)
$0.right.equalToSuperview().inset(36)
$0.height.equalTo(55)
}

checkTextField.snp.makeConstraints{
$0.top.equalTo(checkPassWordTextField.snp.bottom).offset(25)
$0.left.equalToSuperview().inset(38)
$0.right.equalToSuperview().inset(36)
$0.height.equalTo(55)
}

signUpButton.snp.makeConstraints{
$0.top.equalTo(checkTextField.snp.bottom).offset(60)
$0.left.equalToSuperview().inset(44)
$0.right.equalToSuperview().inset(44)
$0.height.equalTo(55)
}

loginButton.snp.makeConstraints{
$0.top.equalTo(signUpButton.snp.bottom).offset(30)
$0.centerX.equalToSuperview()
}
}


}