-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/#354 퀘스트 상단 탭바 구현 #358
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
Open
dev-domo
wants to merge
20
commits into
develop
Choose a base branch
from
feat/#354-questTopTabBar
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+435
−14
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b0bbddb
fix: #346 실제로 시스템 설정에 다녀온 경우에만 checkNotificationAuthorizationWhenBack 호출
dev-domo 089f3a6
refactor: #346 최신 토글 상태 변수를 실제 토글 버튼의 isOn 속성으로 초기화
dev-domo 4d6be1e
setting: 프로비저닝 파일 업데이트
dev-domo 430cc36
style: #346 탭바 구현에 필요한 이미지 세팅
dev-domo 2f0cf17
feat: #346 상단 탭바 설계
dev-domo c165f21
feat: #346 퀘스트 전체 조회 뷰에 상단 탭바 적용
dev-domo c11f62b
refactor: #346 퀘스트 뷰로 이동하는 메서드 추가
dev-domo 3b6eea6
setting: #346 entitlements 수정
dev-domo fe06d5f
setting: #354 프로피버징 파일 설정 변경
dev-domo be574f9
Merge branch 'fix/#346-questToggle' into feat/#354-questTopTabBar
dev-domo 74cd809
feat: #354 상단 탭바 구현
dev-domo 4e1e3b2
feat: #354 퀘스트 조회 화면용 탭 아이템 구현
dev-domo d6d1d62
feat: #354 공통 퀘스트 뷰컨트롤러 생성
dev-domo df0f855
refactor: #354 새로운 퀘스트 조회 뷰컨트롤러로 이동하는 로직 추가
dev-domo af5cbce
style: #354 퀘스트 상단 탭바에 필요한 이미지 세팅
dev-domo 8276d47
fix: #354 퀘스트 토글 오류 수정
dev-domo 16738a5
Merge remote-tracking branch 'origin/feat/#354-questTopTabBar' into f…
dev-domo c37cee6
setting: #354 entitlements 설정 복구
dev-domo 1af4c50
refactor: #354 변수명 수정
dev-domo 8aab424
refactor: #354 메서드명 수정
dev-domo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
ByeBoo-iOS/ByeBoo-iOS/Presentation/Common/TopTabBar/TabItem.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // | ||
| // TabItem.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by APPLE on 2/12/26. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| protocol TabItem: CaseIterable { | ||
| var title: String { get } | ||
| var image: UIImage { get } | ||
| var viewController: UIViewController { get } | ||
| } |
71 changes: 71 additions & 0 deletions
71
ByeBoo-iOS/ByeBoo-iOS/Presentation/Common/TopTabBar/TopTabBar.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // | ||
| // TopTabBar.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by APPLE on 2/12/26. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| final class TopTabBar: UIStackView { | ||
|
|
||
| private let itemViews: [TopTabBarItemView] | ||
| var didTap: ((Int) -> Void)? | ||
|
|
||
| init(items: [any TabItem]) { | ||
| self.itemViews = items.map { TopTabBarItemView(item: $0) } | ||
| super.init(frame: .zero) | ||
|
|
||
| setStyle() | ||
| setUI() | ||
| setAction() | ||
| } | ||
|
|
||
| required init(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| private func setStyle() { | ||
| self.do { | ||
| $0.backgroundColor = .grayscale900 | ||
| $0.axis = .horizontal | ||
| $0.spacing = 4 | ||
| $0.distribution = .fillEqually | ||
| } | ||
| } | ||
|
|
||
| private func setUI() { | ||
| itemViews.forEach { self.addArrangedSubview($0) } | ||
| } | ||
|
|
||
| private func setAction() { | ||
| itemViews.enumerated().forEach { index, itemView in | ||
| let tapGesture = UITapGestureRecognizer( | ||
| target: self, action: #selector(barDidTap(_:)) | ||
| ) | ||
| itemView.addGestureRecognizer(tapGesture) | ||
| itemView.tag = index | ||
| } | ||
|
|
||
| if let firstIndex = itemViews.indices.first { | ||
| updateTabBar(tag: firstIndex) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension TopTabBar { | ||
|
|
||
| @objc | ||
| private func barDidTap(_ sender: UITapGestureRecognizer) { | ||
| guard let tag = sender.view?.tag else { | ||
| return | ||
| } | ||
|
|
||
| didTap?(tag) | ||
| updateTabBar(tag: tag) | ||
| } | ||
|
|
||
| private func updateTabBar(tag: Int) { | ||
| itemViews.forEach { $0.updateBarItem(for: tag) } | ||
| } | ||
| } |
92 changes: 92 additions & 0 deletions
92
ByeBoo-iOS/ByeBoo-iOS/Presentation/Common/TopTabBar/TopTabBarItemView.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| // | ||
| // TopTabBarItemView.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by APPLE on 2/12/26. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| final class TopTabBarItemView: BaseView { | ||
|
|
||
| private let tabStackView = UIStackView() | ||
| private let tabImageView = UIImageView() | ||
| private let tabNameLabel = UILabel() | ||
| private let underlineLabel = UILabel() | ||
|
|
||
| init(item: any TabItem) { | ||
| tabImageView.image = item.image | ||
| tabNameLabel.text = item.title | ||
|
|
||
| super.init(frame: .zero) | ||
| } | ||
|
|
||
| required init?(coder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| override func setStyle() { | ||
| tabStackView.do { | ||
| $0.axis = .horizontal | ||
| $0.spacing = 2 | ||
| $0.alignment = .center | ||
| } | ||
| tabNameLabel.do { | ||
| $0.textColor = .grayscale100 | ||
| $0.font = FontManager.body2M16.font | ||
| $0.textAlignment = .center | ||
| } | ||
| underlineLabel.do { | ||
| $0.layer.borderColor = UIColor.grayscale300.cgColor | ||
| $0.layer.borderWidth = 1 | ||
| } | ||
| } | ||
|
|
||
| override func setUI() { | ||
| addSubviews( | ||
| tabStackView, | ||
| underlineLabel | ||
| ) | ||
| tabStackView.addArrangedSubviews( | ||
| tabImageView, | ||
| tabNameLabel | ||
| ) | ||
| } | ||
|
|
||
| override func setLayout() { | ||
| tabStackView.snp.makeConstraints { | ||
| $0.top.equalToSuperview() | ||
| $0.centerX.equalToSuperview() | ||
| $0.width.equalTo(108.adjustedW) | ||
| $0.height.equalTo(24.adjustedH) | ||
| } | ||
| tabImageView.snp.makeConstraints { | ||
| $0.size.equalTo(24.adjustedW) | ||
| $0.verticalEdges.equalToSuperview() | ||
| $0.leading.equalToSuperview().inset(9.5.adjustedW) | ||
| } | ||
| tabNameLabel.snp.makeConstraints { | ||
| $0.leading.equalTo(tabImageView.snp.trailing).offset(2.adjustedW) | ||
| $0.centerY.equalToSuperview() | ||
| $0.trailing.equalToSuperview().inset(11.5.adjustedW) | ||
| } | ||
| underlineLabel.snp.makeConstraints { | ||
| $0.top.equalTo(tabStackView.snp.bottom).offset(4.adjustedH) | ||
| $0.horizontalEdges.equalToSuperview() | ||
| $0.height.equalTo(1.adjustedH) | ||
| $0.bottom.equalToSuperview() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension TopTabBarItemView { | ||
|
|
||
| func updateBarItem(for tag: Int) { | ||
| let condition = (self.tag == tag) | ||
|
|
||
| tabImageView.layer.opacity = condition ? 1 : 0.44 | ||
| tabNameLabel.textColor = condition ? .grayscale100 : .grayscale600 | ||
| underlineLabel.layer.borderColor = condition ? UIColor.grayscale300.cgColor : UIColor.clear.cgColor | ||
| underlineLabel.layer.borderWidth = condition ? 1 : 0 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/Common/QuestTabItem.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // | ||
| // QuestTabItem.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by APPLE on 2/12/26. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| enum QuestTabItem: TabItem { | ||
|
|
||
| case myJourney | ||
| case commonJourney | ||
|
|
||
| var title: String { | ||
| switch self { | ||
| case .myJourney: | ||
| return "나의 여정" | ||
| case .commonJourney: | ||
| return "공통 여정" | ||
| } | ||
| } | ||
|
|
||
| var image: UIImage { | ||
| switch self { | ||
| case .myJourney: | ||
| return .myJourney | ||
| case .commonJourney: | ||
| return .commonJourney | ||
| } | ||
| } | ||
|
|
||
| var viewController: UIViewController { | ||
| switch self { | ||
| case .myJourney: | ||
| return ViewControllerFactory.shared.makeQuestViewController() | ||
| case .commonJourney: | ||
| return ViewControllerFactory.shared.makeCommonQuestViewController() | ||
| } | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
...-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewController/CommonQuestViewController.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // | ||
| // CommonQuestViewController.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by APPLE on 2/12/26. | ||
| // | ||
|
|
||
| final class CommonQuestViewController: BaseViewController { | ||
|
|
||
| override func viewWillAppear(_ animated: Bool) { | ||
| super.viewWillAppear(animated) | ||
| self.navigationController?.setNavigationBarHidden(true, animated: false) | ||
| } | ||
|
|
||
| override func viewWillDisappear(_ animated: Bool) { | ||
| super.viewWillDisappear(animated) | ||
| self.navigationController?.setNavigationBarHidden(false, animated: false) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 변경사항은 as-is랑 to-be가 어떻게 바뀐건가요?