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

1주차 기본,도전,심화과제 PR #6

Merged
merged 8 commits into from
Apr 12, 2022
Merged

1주차 기본,도전,심화과제 PR #6

merged 8 commits into from
Apr 12, 2022

Conversation

meenyweeny
Copy link
Member

@meenyweeny meenyweeny commented Apr 7, 2022

🌱 작업한 내용

  • 기본과제 구현
  • 도전과제1 구현
  • 도전과제2 구현
  • 심화과제 구현

🌱 PR Point

  • 안녕하세요 ,, 너무 별 거 없어서,, 실망하셧죠 ,, (꾸벅)

  • 오토레이아웃을 안배워서 레이아웃을 정말.. 막 짰습니다!

  • Main 스토리보드는 후에 분명 탭바를 만들 것 같아서, 이번엔 안썼지만 밖에 따로 남겨뒀습니다!

  • 한 스토리보드에 해도 충분히 커버될 1차 과제지만,, 협업에서는 나누니까! 그냥 일부러 나눠보았어요~!
    코드에 대한 이해가 충분하지 않았어서 다른 스토리보드로의 화면전환도 어려워했던 저의 모습을 떠올리며
    그 부분 코드를 좀 눈에 익숙하게 보여드리고자 나눠서 해보았습니다!
    (그니까 철저히 처음 하는 YB 입장에서 짠 코드.. 라는 말~ ^__^)

  • 좀 더 효율적일 부분이,, 있을 수 있겠지만,, 최대한 이지하게 갈겨보았답니다? 조언해주세요 뀨 ㅋㅋ

  • removeTextField는.. 제 사랑 뷰의 생명주기의 중요성 + (텍스트 남아있는게 거슬려서,,) 넣어보앗어요 ~!

  • Extension은,, 에셋 얼추 넣고 한번에 쏵 해보겠습니다~! 이번 과제 .. 에셋.. 안넣엇거든요 .. ^__^ .. 씨익

📸 스크린샷

구현 내용 스크린샷
로그인 로그인
회원가입 회원가입
clear button(도전과제1) clearbutton
버튼 활성화 (도전과제2) 버튼활성화
눈모양누르기 (심화과제) 눈모양

📮 관련 이슈

Copy link

@inuinseoul inuinseoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔쌈하네용

// MARK: - objc function

@objc func textFieldDidChange(_ sender: UITextField) {
loginButton.isEnabled = emailTextField.hasText && passwordTextField.hasText

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 텍스트필드에 hasText라는 프로퍼티가 있나보네요 몰랐어요!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haeText 사용하는게 더 깔끔해보이네요! 배우고 가요~!

Copy link
Member

@hyesuuou hyesuuou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

역시 ㅋㅋ 최고티비 ㅋㅋ ❤️

Comment on lines +32 to +43
private func setUI() {
setButtonUI()
}

private func setButtonUI() {
nextButton.layer.cornerRadius = 15
}

private func setTextField() {
nameTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하 함수나눈거 너무좋아여 ㅋ sarang


// MARK: - IBAction

@IBAction func showPasswordButtonDidTap(_ sender: Any) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DidTap이 이렇게 사람을 행복하게 하는 네이밍이엇나요?

Comment on lines +44 to +49

private func setTextField() {
[emailTextField, passwordTextField].forEach {
$0?.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 delegate 대신 addTarget ~ 좋네요 깔끔하네요

Copy link

@88yhtserof 88yhtserof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 항상 한 스토리보드에 모든 View를 만들었는데 협업 때는 여러 스토리보드로 나누는게 좋은가요?
그리고 코드 잘 보고 가요~!!~!!

@IBOutlet weak var welcomeLabel: UILabel!
@IBOutlet weak var completeButton: UIButton!

// MARK: - LifeCycle

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MARK 주석은 따로 적는건가요?
한 번도 안 해봤는데 코드 보기에 좋네요!! 저도 해야겠어요~~~~~!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MARK 주석 썼을때 효과 .. 별 거 아니지만 오늘 퇴근하구.. 노션에 꼭 적어 올려드릴게요~!

private func setTextField() {
nameTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모든 함수가 간략하고 깔끔해요! 저도 조금 더 작게 나눠서 깔끔하게 만들어 볼게요!!

}

private func removeTextField() {
passwordTextField.text?.removeAll()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 "" 로 초기화 했는데 다음부터는 removeAll 메서드를 써야겠어요..!

completeVC.modalPresentationStyle = .fullScreen
completeVC.userName = userName
self.present(completeVC, animated: true) {
self.navigationController?.popToRootViewController(animated: false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

생각못했는데 present하면서 먼저 popToRoot하는 방법도 좋은 것 같아요!!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오홍 ~ 이런 방법도 있군요 !!

@meenyweeny meenyweeny requested a review from 0inn April 8, 2022 08:40
}
}

private func removeTextField() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 ,, removeTextField 생각도 못한 부분이네요 ,, 선배님 ,, 멋져요 ,,, 경민 선배 ,, 나만의 명예솝트관 ,,, 역시 ,, 매일 찾아와서 봐야겠다 ,,,

Copy link

@pcsoyeon pcsoyeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드가 엄청 깔끔해서 가독성이 미쳤네요 .. 많이 배워갑니다 ~~


@IBAction func nextButtonDidTap(_ sender: Any) {
guard let passwordVC = self.storyboard?.instantiateViewController(withIdentifier: "JoinPasswordViewController") as? JoinPasswordViewController else { return }
passwordVC.userName = nameTextField.text ?? ""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
passwordVC.userName = nameTextField.text ?? ""
guard let name = nameTextField.text else { return }
passwordVC.userName = name

이런식으로 guard let 구문을 활용해서 옵셔널 처리를 할 수 있을 것 같아요 !!

completeVC.modalPresentationStyle = .fullScreen
completeVC.userName = userName
self.present(completeVC, animated: true) {
self.navigationController?.popToRootViewController(animated: false)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오홍 ~ 이런 방법도 있군요 !!

Copy link

@dlwns33 dlwns33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경민아 너무 잘해서 리뷰할게 없음 티비 ㅋㅋ

Comment on lines +60 to +61
@IBAction func nextButtonDidTap(_ sender: Any) {
guard let passwordVC = self.storyboard?.instantiateViewController(withIdentifier: "JoinPasswordViewController") as? JoinPasswordViewController else { return }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier은 혹시 오타가 날수도 있으니 Constant 또는 뷰컨 swift 파일에 미리 적어두는 방법도 좋아!
나중에 Const.VC.JoinPasswordViewController 뭐 이런식으로 자동완성이 될 수 있도록!

@meenyweeny meenyweeny requested a review from L-j-h-c April 9, 2022 06:08
Copy link

@0lynny 0lynny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선배님 코드 잘보구 갑니다!

Comment on lines +25 to +28
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
removeTextField()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앱 생명주기로 다시 돌아왓을 때 textfield지우는 법 배우고 갑니다! 덕분에 앱 생명주기도 찾아보고 왔어용:)

Comment on lines +45 to +48
private func setTextField() {
[emailTextField, passwordTextField].forEach {
$0?.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 찾던 방법이 이거였어요..! 제 코드에서 동일한 구조를 두번 사용해서 똑똑한 코드로 바꾸고 싶었는데 !! 문법 공부의 필요성을 느낍니다!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

딜리게이트 말고 이렇게 되는거 몰랐던...ㅎㅎ 잘 배워가여~

// MARK: - objc function

@objc func textFieldDidChange(_ sender: UITextField) {
loginButton.isEnabled = emailTextField.hasText && passwordTextField.hasText
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haeText 사용하는게 더 깔끔해보이네요! 배우고 가요~!

nameTextField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
}

private func removeTextField() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

진짜 함수를 쪼개서 보니까 코드 이해하기에 너무너무 좋아요!!!! ,,, 세상에,,

setButtonUI()
}

private func setButtonUI() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

버튼 ui도 이런식으로 함수로 쪼개는 방법 ,,, 알아갑니다 !!!💛

Copy link
Member

@L-j-h-c L-j-h-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1차 과제 수고하셨어유~~!!

Comment on lines +45 to +48
private func setTextField() {
[emailTextField, passwordTextField].forEach {
$0?.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

딜리게이트 말고 이렇게 되는거 몰랐던...ㅎㅎ 잘 배워가여~

@meenyweeny meenyweeny merged commit 9cf34a5 into main Apr 12, 2022
@meenyweeny meenyweeny deleted the feature/#2 branch April 12, 2022 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] iOS 1주차 과제