Skip to content

Feature/#4 assignment 2#6

Merged
yangsubinn merged 6 commits intomainfrom
feature/#4-assignment-2
Oct 24, 2021
Merged

Feature/#4 assignment 2#6
yangsubinn merged 6 commits intomainfrom
feature/#4-assignment-2

Conversation

@yangsubinn
Copy link
Copy Markdown
Member

📌 관련 이슈

closed #4

📌 변경 사항 및 이유

지난 과제 때 스토리보드에서 잡았던 오토레이아웃을 제거하고 snapkit 라이브러리를 사용해서 레이아웃을 잡았고,
코드로 탭바를 구현해서 연결해줬습니다.

📌 PR Point

뭔가 더 효율적으로 짤 수 있을 것 같다던지... 맘에 안든다던지.. 하는 부분이 있으면 다 말씀해주세요 쇽샥 열심히 공부해와서 반영하겠습니다
마크를 써서 코드들을 좀 더 보기 쉽게 하려고 했는데 잘.. 보이실까요....

📌 참고 사항

라이브러리랑 에셋 추가한 것 때문에 파일이 굉장히 많은 것 같은데,,, 슉슉 넘겨서 코드부분만 잘 봐주시면 감사하겠습니당...
다음주 시험이라 할 시간이 없을 것 같아서 일찍 했는데,, 천천히 진짜 천천히..! 보시고 코드리뷰 해주세요..!
시험 뿌시고 리뷰 반영하러 오겠슴니다☄️


class AddVC: UIViewController {

// MARK: - Life Cycle
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

오오... 저도 MARK 작성해야겠어요.... 더 깔끔해 보이고 좋은거 같애욤...!

Comment on lines +44 to +92
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)
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

스냅킷이 이렇게 사용하는 거군요..! 과제 리팩토링할때 한번 사용해보겠습니다...!

Copy link
Copy Markdown

@hwangJi-dev hwangJi-dev left a comment

Choose a reason for hiding this comment

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

수빈님.. snapkit 정말 잘쓰시네요! 그리고 MARK로 구분해주셔서 너무 편하게 읽었습니다!!!! 최고짱짱.. 저도 많이 배워갑니다~~👍🏻

let lockerVC = self.storyboard?.instantiateViewController(withIdentifier: "LockerVC")
else {return}

/// 탭바 아이템별 이름
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

오!! 저는 VC별로 묶어서 속성을 지정해줬었는데, 같은 속성끼리 코드를 묶으니까 더 가독성있고 좋네요!!!! 짱입니다👍🏻

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

그러네요!! VC별로 묶어서 지정해주니 훨씬 보기 편한 것 같아요!! 저도 참고해보도록 하겠습니다!! :)


nameTextField.snp.makeConstraints { make in
make.top.equalTo(subLabel.snp.bottom).offset(68)
make.leading.trailing.equalToSuperview().inset(22)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

와 스냅킷 쓸 때 leading, trailing 따로 코드 써줬었는데 이렇게 같이쓰는 방법이 있군요!! 대박 줍줍해갑니다~~~💜

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

이게 바로 스냅킷이군요!! leading, trailing 같이 쓰는 방법 줍줍해갑니다~!! 22ㅎㅎ

logoImageView.image = UIImage(named: "Google")
}

func setupLayout() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

코드 내에서

//MARK:- Layout
extension SignUpViewController {
   func setupLayout() { 
   // 블라블라~~
  }
}

이런 식으로 Layout구성부를 extension으로 밑으로 빼줘도 가독성 측면에서 좋을 것 같아요~~ 🤗

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

아 아예 레이아웃잡는 함수를 extension에도 뺄 수 있군여..! 쇽샥 반영해보겠습니다👍

self.dismiss(animated: true, completion: nil)
/// Main이 아닌 따로 생성한 YouTubeMain이라는 스토리보드를 선언
let youtubeMainStoryboard = UIStoryboard.init(name: "YoutubeMain", bundle: nil)
guard let nextVC = youtubeMainStoryboard.instantiateViewController(withIdentifier: "CustomTabBarController") as? CustomTabBarController else {return}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

TabBarController를 줄여서 TBC 라고 지어줘도 좋을 것 같아요! ㅎㅎ

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

오 TBC...! 저도 바꿔야겠어욤... TBC...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

와오 좋아요.. TabBarController 너무 길더라구요... 쇽샥 갑니다!

Copy link
Copy Markdown

@noah0316 noah0316 left a comment

Choose a reason for hiding this comment

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

마크 사용해주신덕에 어떤 역할을 하는 친구들인지 더 잘 볼 수 있어 좋았습니다~!!ㅎㅎ
같은 결을 가진 친구들을 묶어서 작성해주신 부분들이 인상깊었습니다 선배!!😁

let lockerVC = self.storyboard?.instantiateViewController(withIdentifier: "LockerVC")
else {return}

/// 탭바 아이템별 이름
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

그러네요!! VC별로 묶어서 지정해주니 훨씬 보기 편한 것 같아요!! 저도 참고해보도록 하겠습니다!! :)


nameTextField.snp.makeConstraints { make in
make.top.equalTo(subLabel.snp.bottom).offset(68)
make.leading.trailing.equalToSuperview().inset(22)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

이게 바로 스냅킷이군요!! leading, trailing 같이 쓰는 방법 줍줍해갑니다~!! 22ㅎㅎ

@yangsubinn yangsubinn merged commit 2ace1cb into main Oct 24, 2021
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 2차 과제

4 participants