Skip to content

[Feat] #9 - 탭바 구현#10

Merged
L-j-h-c merged 14 commits intoTeamRecorDream:developfrom
L-j-h-c:feature/#9
Sep 27, 2022
Merged

[Feat] #9 - 탭바 구현#10
L-j-h-c merged 14 commits intoTeamRecorDream:developfrom
L-j-h-c:feature/#9

Conversation

@L-j-h-c
Copy link
Copy Markdown
Contributor

@L-j-h-c L-j-h-c commented Sep 26, 2022

👻 작업한 내용

  • RD-DSKit에 RDTabBarController 구현했고, Presentation에 MainTabBarController 생성했습니다.

🎤 PR Point

PR

  1. 그라데이션 또는 섀도우 넣는 작업이 생각보다 시간이 오래 걸리네요... 슬슬 감을 잡아가기는 하는데 조금 더 반복되는 코드를 줄이려면 앱 전체적으로 필요한 ShaodwFactory를 만드는 것도 좋은 것 같습니다.
  2. 탭바 디자인적으로 살짝 다른 것 같다 하는 부분 있으면 바로 지적해주세여~!

공유

  • Tuist에서 Resource 폴더에 이미지나 폰트, 컬러를 넣어 두면 자동으로 열거형을 생성해주더라구요...! 이미지 넣으시고 모듈명Asset.images해서 호출할 수 있습니다!

image

  • makeFile을 추가해뒀습니다. makeFile이 있는 경로에서 make regenerate 입력하시면 프로젝트 파일이 삭제되고 새로 생성됩니다! tuist에서 모듈 구조가 변경된 경우에 사용하시면 됩니다!

image

  • Gitignore 재적용을 위해서 다음 커맨드 입력해주세요!
git rm -r --cached 

논의하고 싶은 사항

  • ModuleFactory를 만들면 좋을 것 같은데 어떻게 생각하시나요? 이유는 클린 아키텍쳐를 사용하는 만큼 의존성 주입을 해야 할 일이 많아서 이를 전담하는 클래스를 하나 두면 뷰컨이나 뷰모델에서 코드가 많이 줄어들 것 같습니다. 아래에 예시가 있습니다.

image

📸 스크린샷

구현 내용 스크린샷
탭바 Simulator Screen Recording - iPhone 13 - 2022-09-26 at 20 31 24

📮 관련 이슈

@L-j-h-c L-j-h-c added 록시보이 🌽 담당자 feat 구현·개선 사항에 관련된 내용입니다. labels Sep 26, 2022
@L-j-h-c L-j-h-c self-assigned this Sep 26, 2022
Copy link
Copy Markdown
Member

@EunHee-Jeong EunHee-Jeong left a comment

Choose a reason for hiding this comment

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

LGTM


import ProjectDescription

public extension SettingsDictionary {
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.

처음 보는 타입이랑 익스텐션이다...! 맥락상 Fastlane 관련 코드 같다고 생각했는데 찾아보니까 Tuist네요 신기하다...!!
세팅 관련인 건 알겠는데 어떤 식으로 사용되는 건가요? >_<

Copy link
Copy Markdown
Contributor Author

@L-j-h-c L-j-h-c Sep 28, 2022

Choose a reason for hiding this comment

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

@EunHee-Jeong

ProjectDescription은 Tuist에서 swift 소스코드를 통해 프로젝트 파일을 생성할 수 있도록 도와주는 패키지이며, SettingsDictionary 타입은 Xcode의 build settings들을 세팅할 수 있게 도와주는 타입입니다. 이 타입을 extension해서 tuist에서 기본으로 제공하는 xcode build settings에 더하여 저희가 원하는 요소들을 추가할 수 있어요. 아랫 부분에 보시면 CODE_SIGN_STYLE라는 것이 있는데 signing&capability에서 signing을 자동으로 부여할지 수동으로 부여할지에 대한 dictionary 타입입니다. 이런 식으로 원하는 옵션을 설정할 수 있어요!

case forDefault
}

/// 서버에서 들어온 Date String을 UI에 적용 가능한 String 타입으로 반환하는 메서드
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.

그간의 노가다가 스쳐지나간다

Comment on lines +87 to +98
private func addShadowLayer(at btn: UIButton) {
let shadowLayer = CAShapeLayer()
shadowLayer.frame = btn.bounds
shadowLayer.applyShadow(color: UIColor(rgb: 0x000000), alpha: 0.2, x: 0, y: -5, blur: 20, spread: 0)
btn.layer.insertSublayer(shadowLayer, at: 1)

let shadowLayer2 = CAShapeLayer()
shadowLayer2.frame = btn.bounds
shadowLayer2.applyShadow(color: UIColor(rgb: 0xC8CADA), alpha: 1, x: 0, y: 0, blur: 15, spread: 0)
shadowLayer2.masksToBounds = true
shadowLayer2.cornerRadius = 28
btn.layer.insertSublayer(shadowLayer2, at: 2)
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.

객체지향적으로 봤을때, 함수는 필요한 기능들을 묶어서 하나의 단위로 만든 거잖아요! 그래서 함수 안에 들어가는 코드들에는 self를 명시적으로 붙여주는 것이 그 함수가 이 파일에서 필요하다는 의미를 더 살릴 수 있다는 말을 (주워)들었습니다
근데 또 너무 다 붙이면 그렇기도 하고... 음 applyShadow나 insertSublayer 처럼 메소드를 사용하는 줄에는 self 붙여주면 더 좋을 것 같다는 생각이 들었습니다!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@EunHee-Jeong
좋은 의견 감사합니다! 일단 저 코드 자체에서는 btn이 파라미터이기 때문에 self를 붙일 수는 없지만, self를 붙여주는 행위의 의미에 대해 한번 더 생각해볼 수 있었네요~! 다음부터 참고해서 더 좋은 코드 짜볼게요 ㅎㅎ

@EunHee-Jeong
Copy link
Copy Markdown
Member

Module Factory 만드는 거 좋아요~!!

@L-j-h-c L-j-h-c merged commit d9330ca into TeamRecorDream:develop Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 구현·개선 사항에 관련된 내용입니다. 록시보이 🌽 담당자

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 탭바 구현

3 participants