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

[feat] 기본 탭바 구현 #124

Merged
merged 6 commits into from
Jul 6, 2024
Merged

[feat] 기본 탭바 구현 #124

merged 6 commits into from
Jul 6, 2024

Conversation

youz2me
Copy link
Member

@youz2me youz2me commented Jul 5, 2024

🔗 연결된 이슈

📄 작업 내용

  • 로그인 이후 표시되는 탭바 구현했습니다.
  • 에셋 폴더링(Image, Icon)도 같이 진행했습니다.
구현 내용 IPhone 15 pro
GIF

💻 주요 코드 설명

`MainTabBarController.swift`
private func setTabBar() {
        tabBar.unselectedItemTintColor = .gray2
        tabBar.tintColor = .maincolor
        
        setViewControllers([
            UINavigationController(rootViewController: homeViewController),
            UINavigationController(rootViewController: groupViewController),
            UINavigationController(rootViewController: myViewController)
        ], animated: true)
    }
  • 따로 설명할 내용이 없긴 한데 ..
  • 커스텀 탭바를 구현하기 위해 TabbarController 클래스를 생성하고 각 ViewController 객체를 선언했습니다.
  • 이후 setTabBar() 함수 내에서 setViewControllers를 통해 NavigationController에 담아 세팅했습니다. 이후 네비게이션으로 진행되는 플로우를 고려했습니다!
  • 탭바 색상 설정은 각각 tabBar.unselectedItemTintColor, tabBar.tintColor를 통해 진행했습니다.

@youz2me youz2me added ✨ feat 기능 구현시 사용 💚 YouJin 저댄고?저댄고?저댄고?저댄고?저댄고? labels Jul 5, 2024
@youz2me youz2me self-assigned this Jul 5, 2024
@youz2me youz2me linked an issue Jul 5, 2024 that may be closed by this pull request
2 tasks
Copy link
Contributor

@JinUng41 JinUng41 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다.
탭바컨트롤러 구현과 관련하여, 코멘트 남겼는데 확인해 주세요~

추가적으로 코멘트를 하자면, Group -> GroupList / My -> MyPage로 이름을 변경하는 것은 어떤가요?

Comment on lines 16 to 29
private let homeViewController: HomeViewController = HomeViewController().then {
$0.tabBarItem.title = "홈"
$0.tabBarItem.image = .iconHome
}

private let groupViewController: GroupViewController = GroupViewController().then {
$0.tabBarItem.title = "내 모임"
$0.tabBarItem.image = .iconGroup
}

private let myViewController: MyViewController = MyViewController().then {
$0.tabBarItem.title = "마이"
$0.tabBarItem.image = .iconMy
}
Copy link
Contributor

Choose a reason for hiding this comment

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

구현의 차이 일 것 같은데, 저 같은 경우 해당 내용을 setTabBar 함수 내에서 선언하는 편입니다.
그 이유는 MainTabBarController가 앱에서 생명 주기를 유지하는 동안, 3개의 ViewController에 대해서 프로퍼티로 계속 참조를 유지할 필요가 없다고 생각하기 때문인데요. 과장을 보태자면 메모리 낭비일수도 있구요.
어차피 TabBarController의 setViewControllers를 통해 참조가 유지되어, 프로퍼티로의 선언이 불필요하다고 생각합니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

수정했습니다! 트러블 슈팅도 함께 작성해서 노션 페이지 링크도 함께 첨부합니다 ~~! 좋은 의견 감사합니다

https://arrow-frog-4b9.notion.site/8e94fc4c55d84670bed5339ad8df24c3?pvs=4

Copy link
Member

@hooni0918 hooni0918 left a comment

Choose a reason for hiding this comment

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

와고생하셧습니다 멋져요

Copy link
Member

@mmaybei mmaybei left a comment

Choose a reason for hiding this comment

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

짱짱! 수고했다능요~

@youz2me youz2me merged commit a06e2e4 into suyeon Jul 6, 2024
1 check passed
@JinUng41 JinUng41 deleted the feat/#114-base-tabbar branch July 6, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feat 기능 구현시 사용 💚 YouJin 저댄고?저댄고?저댄고?저댄고?저댄고?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 기본 탭바 및 네비게이션 바 구현
4 participants