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

πŸ”€ :: (#1138) μ•„ν‹°μŠ€νŠΈ 리슀트 νŽ˜μ΄μ§€ translucent 적용 #1142

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public final class ArtistViewController:
description: LocalizationStrings.unknownErrorWarning,
retryButtonTitle: LocalizationStrings.titleRetry
)
private let translucentView = UIVisualEffectView(effect: UIBlurEffect(style: .light)).then {
$0.alpha = 0
}

var artistDetailFactory: ArtistDetailFactory!
public var disposeBag: DisposeBag = DisposeBag()
Expand All @@ -34,6 +37,7 @@ public final class ArtistViewController:
addSubviews()
setLayout()
configureUI()
collectionView.delegate = self
}

override public func viewDidAppear(_ animated: Bool) {
Expand Down Expand Up @@ -121,7 +125,7 @@ public final class ArtistViewController:

private extension ArtistViewController {
func addSubviews() {
view.addSubview(retryWarningView)
view.addSubviews(retryWarningView, translucentView)
}

func setLayout() {
Expand All @@ -130,6 +134,11 @@ private extension ArtistViewController {
$0.centerX.equalToSuperview()
$0.top.equalToSuperview().offset(topOffset + STATUS_BAR_HEGHIT())
}

translucentView.snp.makeConstraints {
$0.top.horizontalEdges.equalToSuperview()
$0.bottom.equalTo(view.safeAreaLayoutGuide.snp.top)
}
}

func configureUI() {
Expand All @@ -155,6 +164,13 @@ private extension ArtistViewController {
}
}

extension ArtistViewController: UICollectionViewDelegate {
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
let offsetY: CGFloat = scrollView.contentOffset.y + STATUS_BAR_HEGHIT()
translucentView.alpha = min(max(offsetY / translucentView.frame.height, 0), 1)
}
}

extension ArtistViewController: WMRetryWarningViewDelegate {
public func tappedRetryButton() {
retryWarningView.isHidden = true
Expand Down
Loading