-
Notifications
You must be signed in to change notification settings - Fork 2
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 [#28] onboardingbaseViewController 구현 및 프로그래스바 방식 수정 #33
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0a2d079
[Add/#28] Onboarding - baseViewController 파일 추가
kim-seonwoo 51bc043
[Fix/#28] Onboarding - baseViewController 파일 이슈 해결
kim-seonwoo 56e959d
[Add/#28] Onboarding - ProgressBarManager 파일 추가
kim-seonwoo 1d24f58
[Fix/#28] Onboarding - BaseViewController 싱글톤 활용 변경
kim-seonwoo 4be1c2e
[Feat/#28] Onboarding - progressView 역방향 애니매이션 추가
kim-seonwoo 0a409d4
[Chore/#28] Onboarding - 자잘한 코드 수정
kim-seonwoo 6a61e14
[Chore/#28] Onboarding - ProgressBarManager import 중복 수정
kim-seonwoo 92e96a5
[Feat/#28] String - OnboardingButton StringLiterals 추가
kim-seonwoo 71d213a
[Feat/#28] Onboarding - baseViewController StringLiterals 반영
kim-seonwoo 68473b2
[Fix/#28] Onboarding - 코드리뷰 반영
kim-seonwoo 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 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 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
24 changes: 24 additions & 0 deletions
24
HMH_iOS/HMH_iOS/Presentation/Onboarding/ProgressBarManager.swift
This file contains 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,24 @@ | ||
// | ||
// ProgressBarManager.swift | ||
// HMH_iOS | ||
// | ||
// Created by Seonwoo Kim on 1/8/24. | ||
// | ||
|
||
import UIKit | ||
|
||
class ProgressBarManager { | ||
static let shared = ProgressBarManager() | ||
let progressBarView = OnboardingProgressView() | ||
|
||
var progress: Int = 0 | ||
|
||
func updateProgress(step: Int) { | ||
progressBarView.progressAmount = step | ||
} | ||
|
||
func resetProgress() { | ||
progress = 0 | ||
progressBarView.progressAmount = Int(progress) | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
HMH_iOS/HMH_iOS/Presentation/Onboarding/ViewControllers/OnboardingBaseViewControllers.swift
This file contains 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,80 @@ | ||
// | ||
// OnboardingBaseViewController.swift | ||
// HMH_iOS | ||
// | ||
// Created by Seonwoo Kim on 1/8/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import SnapKit | ||
import Then | ||
|
||
protocol HomeViewPushDelegate: AnyObject { | ||
func didTapButton() | ||
} | ||
|
||
class OnboardingBaseViewController: UIViewController { | ||
weak var delegate: HomeViewPushDelegate? | ||
|
||
var nextButtonText: String = StringLiteral.OnboardingButton.next | ||
let navigationBar = HMHNavigationBar(leftItem: .normal, isBackButton: true, isTitleLabel: false, isPointImage: false, isBackGroundGray: false) | ||
let progressBar = ProgressBarManager.shared.progressBarView | ||
lazy var nextButton = OnboardingButton(buttonStatus: .enabled, buttonText: nextButtonText) | ||
var step = 0 | ||
|
||
override func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false | ||
self.navigationController?.navigationBar.isHidden = true | ||
setUI() | ||
setTarget() | ||
ProgressBarManager.shared.updateProgress(step: step) | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
setUI() | ||
setTarget() | ||
} | ||
|
||
private func setUI() { | ||
setHierarchy() | ||
setConstraints() | ||
} | ||
|
||
func setHierarchy() { | ||
view.addSubviews(navigationBar, nextButton, progressBar) | ||
} | ||
|
||
func setConstraints() { | ||
navigationBar.snp.makeConstraints { | ||
$0.top.trailing.leading.equalToSuperview() | ||
$0.height.equalTo(113.adjustedHeight) | ||
} | ||
|
||
progressBar.snp.makeConstraints { | ||
$0.top.equalTo(navigationBar.snp.bottom) | ||
$0.trailing.leading.equalToSuperview().inset(20.adjusted) | ||
} | ||
|
||
nextButton.snp.makeConstraints { | ||
$0.bottom.equalTo(view.safeAreaLayoutGuide).offset(-21.adjusted) | ||
$0.leading.trailing.equalToSuperview().inset(20.adjusted) | ||
} | ||
} | ||
|
||
func setTarget() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도요 |
||
nextButton.addTarget(self, action: #selector(onTapButton), for: .touchUpInside) | ||
} | ||
|
||
@objc | ||
func onTapButton() { | ||
self.delegate?.didTapButton() | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
This file contains 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 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
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.
p1. private 가시죠