Skip to content

Conversation

@cirtuare
Copy link
Contributor

@cirtuare cirtuare commented May 23, 2025

🐿️ Pull Requests

🪵 작업 브랜치

🥔 작업 내용

2.0 프로필 + 탈퇴 UI & 탭바 UI 작업 및 업로드 UI 등 일부 UI 수정했습니다
피알이 너무 길어진 관게로 나머지 설정 UI는 다른 브랜치에서 작업하겠습니다!

🚨 참고 사항

ScreenUtils.horizontalInset 추가 및 적용

static var horizontalInset: CGFloat {
    return ScreenUtils.widthRatio * 16
}

ACToastController 재정립

ACToastView에 글라스모피즘 적용 및 토스트 자체에 액션 추가를 구현했습니다. 자세한 내용은 Global > UIComponents > ACToast 그룹을 참고해주세요.

사용법

우선 ACToastType에 새로운 ToastType 선언한 뒤,ACToastController.show(...)로 불러주세요 !

final class ACToastController {
     static func show(_ acToastType: ACToastType,
                                  bottomInset: Int = 93,
                                  delayTime: Double = 2.0,
                                  tapAction: (() -> Void)? = nil)
}
ACToastController.show(.profileSaved, delayTime: 1)

GlassmorphismView 하얗게 뜨는 오류 해결

기존 글모 뷰가 init된 후 window에서 해제, 다시 window에 등장할 때 블러 효과가 제대로 렌더링되지 않아 하얗게 뜨는 오류가 있었습니다. window에 등장할 때마다 기존 블러 효과를 제거하고, 다시 적용합니다.

// GlassmorphismView
override func didMoveToWindow() {
      super.didMoveToWindow()
      
      // NOTE: 뷰 등장 시 기존 효과를 완전히 제거하고 다시 설정
      if window != nil {
          refreshBlurEffect()
      }
  }

// MARK: - Refresh Blur Effect
extension GlassmorphismView {
    
    func refreshBlurEffect() {
        blurEffectView.effect = nil
        vibrancyEffectView.effect = nil
        
        DispatchQueue.main.async {
            self.setGlassMorphism(self.glassMorphismType)
        }
    }
    
}

단, cell의 subview인 GlassButton은 cell이 렌더링되는 시점에 블러 효과를 재렌더링 해주어야 했습니다. 이에 따라 didMoveToWindow가 아닌 cell.prepareForReuse에서의 재렌더링이 필요해 다음과 같이 ACButton에 refreshBlurEffect 메소드를 추가하고, cell파일에 prepareForReuse()에서 해당 메소드를 호출했습니다.

// MARK: - Refresh Glassbutton BlurEffect
extension ACButton {
    // NOTE: 정상적인 버튼 글라스모피즘 적용을 위해 Cell prepareForReuse에서 호출
    func refreshBlurEffect() {
        if let glassmorphismView = glassmorphismView {
            glassmorphismView.refreshBlurEffect()
        }
        
        if let borderGlassmorphismView = borderGlassmorphismView {
            borderGlassmorphismView.refreshBlurEffect()
        }
    }
}
// SpotListCollectionViewCell
override func prepareForReuse() {
    super.prepareForReuse()
    
    findCourseButton.refreshBlurEffect()
}

💥 To be sure

  • 모든 뷰가 잘 실행되는지 다시 한 번 체크해주세요 !

🌰 Resolve issue

@cirtuare cirtuare requested a review from yurim830 May 23, 2025 16:52
@cirtuare cirtuare self-assigned this May 23, 2025
@cirtuare cirtuare added 🌀 feature 새로운 기능 개발 🍓 수민 수민 labels May 23, 2025
Copy link
Collaborator

@yurim830 yurim830 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~!

Comment on lines +74 to +87
// MARK: - Tap Action

private extension ACToastView {

@objc
func handleTapAction() {
tapAction?()
}

func addTapAction() {
let tapGesture = UITapGestureRecognizer(target: self,
action: #selector(handleTapAction))
self.isUserInteractionEnabled = true
self.addGestureRecognizer(tapGesture)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🐿️ 책임 분리를 위해 Action을 ACToastVC에서 설정하면 어떨까요? 혹시 View에서 설정하신 다른 이유가 있으실까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ACToastController은 VC가 아니에요 !! 그러므로 TapGestureRecognizer 등의 추가도 불가합니다.
ACToastController가 UIControl 등을 상속받는 방법도 고민을 해봤으나, 구조상 그냥 View에서 구현하는 방법이 깔끔할 것 같아서 이렇게 설정했습니다!

Comment on lines -39 to -40
private let acornCountBox = ProfileBoxComponent()

Copy link
Collaborator

Choose a reason for hiding this comment

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

🐿️ ProfileBoxComponent 파일은 삭제 안 하신 것 같은데, 혹시 추후 다시 쓰일 가능성때문에 그런가요?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

으앗 삭제를 깜빡했네요 ㅠㅠ 감사합니다 🙇‍♀️

@cirtuare cirtuare merged commit 66368a4 into develop May 23, 2025
@cirtuare cirtuare deleted the feature/#149 branch August 12, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌀 feature 새로운 기능 개발 🍓 수민 수민

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 2.0 프로필 UI 및 탭바 UI

3 participants