Skip to content

Commit

Permalink
✅[CHORE] 코드리뷰 반영 수정(#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsubinn committed Oct 24, 2021
1 parent d55cbb7 commit 0a3f898
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* Begin PBXBuildFile section */
2BBF45B9271688AD00686134 /* YoutubeMain.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2BBF45B8271688AD00686134 /* YoutubeMain.storyboard */; };
2BBF45BB2716890300686134 /* CustomTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BBF45BA2716890300686134 /* CustomTabBarController.swift */; };
2BBF45BB2716890300686134 /* CustomTBC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BBF45BA2716890300686134 /* CustomTBC.swift */; };
2BBF45BD2716891E00686134 /* HomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BBF45BC2716891E00686134 /* HomeVC.swift */; };
2BBF45BF2716892B00686134 /* ShortsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BBF45BE2716892B00686134 /* ShortsVC.swift */; };
2BBF45C12716893B00686134 /* AddVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BBF45C02716893B00686134 /* AddVC.swift */; };
Expand All @@ -30,7 +30,7 @@
1E0BF1C4A0D185311E8AC6CE /* Pods-29th-iOS-Assignment.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-29th-iOS-Assignment.release.xcconfig"; path = "Target Support Files/Pods-29th-iOS-Assignment/Pods-29th-iOS-Assignment.release.xcconfig"; sourceTree = "<group>"; };
2B76D5275535EEC539B4BEEF /* Pods_29th_iOS_Assignment.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_29th_iOS_Assignment.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2BBF45B8271688AD00686134 /* YoutubeMain.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = YoutubeMain.storyboard; sourceTree = "<group>"; };
2BBF45BA2716890300686134 /* CustomTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTabBarController.swift; sourceTree = "<group>"; };
2BBF45BA2716890300686134 /* CustomTBC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTBC.swift; sourceTree = "<group>"; };
2BBF45BC2716891E00686134 /* HomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeVC.swift; sourceTree = "<group>"; };
2BBF45BE2716892B00686134 /* ShortsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortsVC.swift; sourceTree = "<group>"; };
2BBF45C02716893B00686134 /* AddVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddVC.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -117,7 +117,7 @@
2BF508E3270B0BCB004EF83D /* LoginViewController.swift */,
2BF508E5270B0EE6004EF83D /* SignupViewController.swift */,
2BF508E7270B0F18004EF83D /* SuccessViewController.swift */,
2BBF45BA2716890300686134 /* CustomTabBarController.swift */,
2BBF45BA2716890300686134 /* CustomTBC.swift */,
2BBF45BC2716891E00686134 /* HomeVC.swift */,
2BBF45BE2716892B00686134 /* ShortsVC.swift */,
2BBF45C02716893B00686134 /* AddVC.swift */,
Expand Down Expand Up @@ -272,7 +272,7 @@
2BF508E4270B0BCB004EF83D /* LoginViewController.swift in Sources */,
2BBF45BD2716891E00686134 /* HomeVC.swift in Sources */,
2BBF45C5271689B100686134 /* LockerVC.swift in Sources */,
2BBF45BB2716890300686134 /* CustomTabBarController.swift in Sources */,
2BBF45BB2716890300686134 /* CustomTBC.swift in Sources */,
2BF508CB270B0A50004EF83D /* AppDelegate.swift in Sources */,
2BBF45C12716893B00686134 /* AddVC.swift in Sources */,
2BE4D6E62715F0DD00436945 /* UIVIewController+Extension.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@
</objects>
<point key="canvasLocation" x="1003" y="753"/>
</scene>
<!--CustomTabBarController-->
<!--CustomTBC-->
<scene sceneID="KGm-Ed-HuL">
<objects>
<tabBarController storyboardIdentifier="CustomTabBarController" title="CustomTabBarController" id="QFe-0z-xak" customClass="CustomTabBarController" customModule="_9th_iOS_Assignment" customModuleProvider="target" sceneMemberID="viewController">
<tabBarController storyboardIdentifier="CustomTabBarController" title="CustomTBC" id="QFe-0z-xak" customClass="CustomTBC" customModule="_9th_iOS_Assignment" customModuleProvider="target" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="LGN-D3-qIo">
<rect key="frame" x="0.0" y="0.0" width="414" height="49"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class CustomTabBarController: UITabBarController {
class CustomTBC: UITabBarController {

// MARK: - Life Cycle
override func viewDidLoad() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,87 @@ class LoginViewController: UIViewController {
subLabel.text = "Youtube도 이동하면서 계속하세요.\n앱 및 safari에서도 Google 서비스에 로그인됩니다."
}

// func setupLayout() {
// logoImageView.snp.makeConstraints { make in
// make.top.equalToSuperview().offset(100)
// make.centerX.equalToSuperview()
// make.width.equalTo(117)
// make.height.equalTo(40)
// }
//
// titleLabel.snp.makeConstraints { make in
// make.top.equalTo(logoImageView.snp.bottom).offset(14)
// make.centerX.equalToSuperview()
// }
//
// subLabel.snp.makeConstraints { make in
// make.top.equalTo(titleLabel.snp.bottom).offset(14)
// make.centerX.equalToSuperview()
// }
//
// nameTextField.snp.makeConstraints { make in
// make.top.equalTo(subLabel.snp.bottom).offset(68)
// make.leading.trailing.equalToSuperview().inset(22)
// make.height.equalTo(50)
// }
//
// emailTextField.snp.makeConstraints { make in
// make.top.equalTo(nameTextField.snp.bottom).offset(17)
// make.leading.trailing.equalToSuperview().inset(22)
// make.height.equalTo(50)
// }
//
// pwTextField.snp.makeConstraints { make in
// make.top.equalTo(emailTextField.snp.bottom).offset(17)
// make.leading.trailing.equalToSuperview().inset(22)
// make.height.equalTo(50)
// }
//
// signUpButton.snp.makeConstraints { make in
// make.top.equalTo(pwTextField.snp.bottom).offset(73)
// make.leading.equalToSuperview().inset(22)
// }
//
// nextButton.snp.makeConstraints { make in
// make.centerY.equalTo(signUpButton.snp.centerY)
// make.trailing.equalToSuperview().inset(22)
// make.width.equalTo(74)
// make.height.equalTo(50)
// }
// }

func setupAddTarget() {
/// 요소에 따라 정의해둔 함수를 실행
nameTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
emailTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
pwTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
}

// MARK: - @IBAction
@IBAction func touchUpToSuccess(_ sender: Any) {
guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "SuccessViewController") as? SuccessViewController else {return}

nextVC.message = nameTextField.text
nextVC.modalPresentationStyle = .fullScreen
self.present(nextVC, animated: true, completion: nil)
}

@IBAction func touchUpToSignup(_ sender: Any) {
guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "SignupViewController") else {return}

self.navigationController?.pushViewController(nextVC, animated: true)
}

// MARK: - @objc
/// textField 변화에 따라 수행할 함수
@objc
func textFieldDidChange(textField: UITextField) {
nextButton.isEnabled = nameTextField.hasText && emailTextField.hasText && pwTextField.hasText ? true : false
}
}

// MARK: - Layout
extension LoginViewController {
func setupLayout() {
logoImageView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(100)
Expand Down Expand Up @@ -89,33 +170,4 @@ class LoginViewController: UIViewController {
make.height.equalTo(50)
}
}

func setupAddTarget() {
/// 요소에 따라 정의해둔 함수를 실행
nameTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
emailTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
pwTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
}

// MARK: - @IBAction
@IBAction func touchUpToSuccess(_ sender: Any) {
guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "SuccessViewController") as? SuccessViewController else {return}

nextVC.message = nameTextField.text
nextVC.modalPresentationStyle = .fullScreen
self.present(nextVC, animated: true, completion: nil)
}

@IBAction func touchUpToSignup(_ sender: Any) {
guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "SignupViewController") else {return}

self.navigationController?.pushViewController(nextVC, animated: true)
}

// MARK: - @objc
/// textField 변화에 따라 수행할 함수
@objc
func textFieldDidChange(textField: UITextField) {
nextButton.isEnabled = nameTextField.hasText && emailTextField.hasText && pwTextField.hasText ? true : false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,89 @@ class SignupViewController: UIViewController {
logoImageView.image = UIImage(named: "Google")
}

// func setupLayout() {
// logoImageView.snp.makeConstraints { make in
// make.top.equalToSuperview().offset(100)
// make.centerX.equalToSuperview()
// make.width.equalTo(117)
// make.height.equalTo(40)
// }
//
// titleLabel.snp.makeConstraints { make in
// make.top.equalTo(logoImageView.snp.bottom).offset(14)
// make.centerX.equalToSuperview()
// }
//
// nameTextField.snp.makeConstraints { make in
// make.top.equalTo(titleLabel.snp.bottom).offset(128)
// make.leading.trailing.equalToSuperview().inset(22)
// make.height.equalTo(50)
// }
//
// emailTextField.snp.makeConstraints { make in
// make.top.equalTo(nameTextField.snp.bottom).offset(17)
// make.leading.trailing.equalToSuperview().inset(22)
// make.height.equalTo(50)
// }
//
// pwTextField.snp.makeConstraints { make in
// make.top.equalTo(emailTextField.snp.bottom).offset(17)
// make.leading.trailing.equalToSuperview().inset(22)
// make.height.equalTo(50)
// }
//
// showPwButton.snp.makeConstraints { make in
// make.top.equalTo(pwTextField.snp.bottom).offset(17)
// make.leading.equalToSuperview().inset(21)
// make.width.height.equalTo(18)
// }
//
// showPwLabel.snp.makeConstraints { make in
// make.centerY.equalTo(showPwButton.snp.centerY)
// make.leading.equalTo(showPwButton.snp.trailing).offset(11)
// }
//
// nextButton.snp.makeConstraints { make in
// make.top.equalTo(showPwButton.snp.bottom).offset(31)
// make.leading.trailing.equalToSuperview().inset(22)
// make.height.equalTo(50)
// }
// }

func setupAddTarget() {
/// 요소에 따라 정의해둔 함수를 실행
nameTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
emailTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
pwTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
showPwButton.addTarget(self, action: #selector(showPwButtonClicked(button:)), for: .touchUpInside)
}

// MARK: - @IBAction
@IBAction func touchUpToSuccess(_ sender: Any) {
guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "SuccessViewController") as? SuccessViewController else {return}

nextVC.message = nameTextField.text
nextVC.modalPresentationStyle = .fullScreen
self.present(nextVC, animated: true, completion: nil)
}

// MARK: - @objc
/// textField 변화에 따라 수행할 함수
@objc
func textFieldDidChange(textField: UITextField) {
nextButton.isEnabled = nameTextField.hasText && emailTextField.hasText && pwTextField.hasText ? true : false
}

/// 비밀번호 표시 버튼에 따라 수행할 함수
@objc
func showPwButtonClicked(button: UIButton) {
pwTextField.isSecureTextEntry = pwTextField.isSecureTextEntry == true ? false : true
showPwButton.tintColor = pwTextField.isSecureTextEntry == true ? .lightGray : .systemBlue
}
}

// MARK: - Layout
extension SignupViewController {
func setupLayout() {
logoImageView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(100)
Expand Down Expand Up @@ -86,35 +169,4 @@ class SignupViewController: UIViewController {
make.height.equalTo(50)
}
}

func setupAddTarget() {
/// 요소에 따라 정의해둔 함수를 실행
nameTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
emailTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
pwTextField.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: UIControl.Event.editingChanged)
showPwButton.addTarget(self, action: #selector(showPwButtonClicked(button:)), for: .touchUpInside)
}

// MARK: - @IBAction
@IBAction func touchUpToSuccess(_ sender: Any) {
guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "SuccessViewController") as? SuccessViewController else {return}

nextVC.message = nameTextField.text
nextVC.modalPresentationStyle = .fullScreen
self.present(nextVC, animated: true, completion: nil)
}

// MARK: - @objc
/// textField 변화에 따라 수행할 함수
@objc
func textFieldDidChange(textField: UITextField) {
nextButton.isEnabled = nameTextField.hasText && emailTextField.hasText && pwTextField.hasText ? true : false
}

/// 비밀번호 표시 버튼에 따라 수행할 함수
@objc
func showPwButtonClicked(button: UIButton) {
pwTextField.isSecureTextEntry = pwTextField.isSecureTextEntry == true ? false : true
showPwButton.tintColor = pwTextField.isSecureTextEntry == true ? .lightGray : .systemBlue
}
}
Loading

0 comments on commit 0a3f898

Please sign in to comment.