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

Feature/#4 #8

Open
wants to merge 2 commits into
base: main
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
184 changes: 148 additions & 36 deletions GO-SOPT-TVING/GO-SOPT-TVING.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"pins" : [
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire.git",
"state" : {
"revision" : "bc268c28fb170f494de9e9927c371b8342979ece",
"version" : "5.7.1"
}
},
{
"identity" : "inject",
"kind" : "remoteSourceControl",
Expand All @@ -9,6 +18,15 @@
"version" : "1.2.3"
}
},
{
"identity" : "kingfisher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/onevcat/Kingfisher.git",
"state" : {
"revision" : "af4be924ad984cf4d16f4ae4df424e79a443d435",
"version" : "7.6.2"
}
},
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "btn_before.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "자산 [email protected]",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "자산 3@[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "자산 3@[email protected]",
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "dog.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "자산 [email protected]",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "자산 4@[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "자산 4@[email protected]",
"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.
19 changes: 19 additions & 0 deletions GO-SOPT-TVING/GO-SOPT-TVING/Base/BaseView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import UIKit

class BaseView: UIView {

override init(frame: CGRect) {
super.init(frame: frame)

Style()
setLayout()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func Style() {}
func setLayout() {}
}
52 changes: 52 additions & 0 deletions GO-SOPT-TVING/GO-SOPT-TVING/Base/BaseViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import UIKit

class BaseViewController: UIViewController {

// MARK: Properties

lazy private(set) var className: String = {
return type(of: self).description().components(separatedBy: ".").last ?? ""
}()

// MARK: Initializing

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nil, bundle: nil)
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

deinit {
print("DEINIT: \(className)")
}

// MARK: Life Cycle
override func viewDidLoad() {
super.viewDidLoad()

Style()
setLayout()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

navigationController?.setNavigationBarHidden(true, animated: true)
}

// MARK: UI

/// Attributes (속성) 설정 메서드
func Style() {

view.backgroundColor = .white
}

/// Hierarchy, Constraints (계층 및 제약조건) 설정 메서드
func setLayout() {}

}

3 changes: 3 additions & 0 deletions GO-SOPT-TVING/GO-SOPT-TVING/Extension/UIColor+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ extension UIColor {
class var textGrey1: UIColor {
return UIColor(hex: "D6D6D6")
}
class var back19: UIColor {
return UIColor(hex: "191919")
}

}
4 changes: 4 additions & 0 deletions GO-SOPT-TVING/GO-SOPT-TVING/Extension/UIView+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ extension UIView {
func addSubviews(_ views: UIView...) {
views.forEach { self.addSubview($0) }
}

static var className: String {
get { return String(describing: self)}
}
}
9 changes: 9 additions & 0 deletions GO-SOPT-TVING/GO-SOPT-TVING/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>$(API_KEY)</string>
<key>BASE_URL</key>
<string>$(BASE_URL)</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Regular.otf</string>
Expand Down
39 changes: 24 additions & 15 deletions GO-SOPT-TVING/GO-SOPT-TVING/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//

import UIKit
import Then
import SnapKit

class LoginView: UIView {

Expand All @@ -26,9 +28,16 @@ class LoginView: UIView {
$0.textColor = .textGrey2
$0.backgroundColor = .textGrey4
$0.keyboardType = .default
if let clearButton = $0.value(forKeyPath: "_clearButton") as? UIButton {
clearButton.setImage(UIImage(named: "x-circle"), for: .normal)
}
// if let clearButton = $0.value(forKeyPath: "_clearButton") as? UIButton {
// clearButton.setImage(UIImage(named: "x-circle"), for: .normal)
// }
//
// if let clearButton = $0.value(forKeyPath: "_clearButton") as? UIButton {
// clearButton.setImage(UIImage(named: "x-circle"), for: .normal)
// let buttonSize = CGSize(width: 20, height: 20) // 원하는 크기로 수정
// clearButton.frame = CGRect(origin: clearButton.frame.origin, size: buttonSize)
// }
//
$0.clearButtonMode = UITextField.ViewMode.whileEditing
$0.setLeftPaddingPoints(22)
$0.layer.cornerRadius = 3
Expand All @@ -42,11 +51,11 @@ class LoginView: UIView {
$0.textColor = .textGrey2
$0.backgroundColor = .textGrey4
$0.keyboardType = .default
//Clear Button 이미지 변경
if let clearButton = $0.value(forKeyPath: "_clearButton") as? UIButton {
clearButton.setImage(UIImage(named: "x-circle"), for: .normal)
}
//
// //Clear Button 이미지 변경
// if let clearButton = $0.value(forKeyPath: "_clearButton") as? UIButton {
// clearButton.setImage(UIImage(named: "x-circle"), for: .normal)
// }
//텍스트필드에 글자를 쓰고 있을때 클리어 버튼이 나타나도록
$0.clearButtonMode = UITextField.ViewMode.whileEditing

Expand All @@ -66,7 +75,6 @@ class LoginView: UIView {
$0.layer.borderColor = UIColor.textGrey4.cgColor
$0.titleLabel?.textAlignment = .center
$0.layer.cornerRadius = 3

}

public lazy var findIDButton = UIButton().then {
Expand Down Expand Up @@ -141,9 +149,6 @@ private extension LoginView {

func style() {
self.backgroundColor = .black
}

func setLayout() {
[backButton,
loginLabel,
idTextField,
Expand All @@ -159,6 +164,9 @@ private extension LoginView {
securityButton].forEach {
self.addSubview($0)
}
}

func setLayout() {

backButton.snp.makeConstraints{
$0.height.equalTo(15)
Expand Down Expand Up @@ -229,12 +237,13 @@ private extension LoginView {
}

clearIDButton.snp.makeConstraints{
$0.size.equalTo(20)
$0.width.equalTo(20)
$0.height.equalTo(20)
$0.trailing.equalTo(passwordTextField.snp.trailing).offset(-14)
$0.centerY.equalTo(idTextField.snp.centerY)
}


clearPWButton.snp.makeConstraints{
$0.size.equalTo(20)
$0.trailing.equalTo(passwordTextField).offset(-56)
Expand Down
8 changes: 6 additions & 2 deletions GO-SOPT-TVING/GO-SOPT-TVING/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class LoginViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
configureUI()
style()
setLayout()
setReact()
// Do any additional setup after loading the view.
}

func configureUI() {
func style() {
view.addSubview(loginView)
}

Expand All @@ -39,6 +39,7 @@ class LoginViewController: UIViewController {
loginView.clearIDButton.addTarget(self, action: #selector(tappedClearIDButton), for: .touchUpInside)
loginView.clearPWButton.addTarget(self, action: #selector(tappedClearPWButton), for: .touchUpInside)
loginView.securityButton.addTarget(self, action: #selector(tappedSecurityButton), for: .touchUpInside)

}

func hideButton() {
Expand All @@ -59,6 +60,9 @@ class LoginViewController: UIViewController {
welcomeVC.userName(name: loginView.idTextField.text ?? "")
navigationController?.pushViewController(welcomeVC, animated: true)
}




@objc
func tappedClearIDButton() {
Expand Down
Loading