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/NST-62] #31 AppToast, ToastManager 작성 #32

Merged
merged 6 commits into from
Feb 11, 2025
Merged

Conversation

FpRaArNkK
Copy link
Collaborator

@FpRaArNkK FpRaArNkK commented Feb 2, 2025

🔥 Issue

close #31


🔥 변경된 내용

  • 앱 내 전반적으로 사용되는 AppToast와 이를 관리하는 ToastManager를 작성했습니다.
  • 기존 Global 폴더에 노출되어있던 컴포넌트 파일들을 Components 폴더로 이동했습니다.
  • pretendardStyled extension에 textColor를 추가했습니다.

🔥 PR Point

  1. AppToastView 컴포넌트는 단순한 캡슐형 텍스트 컴포넌트입니다.
    내부 enum인 Status에 의해 UI 표시 스타일이 결정됩니다.
    사용법은 다음과 같습니다.
AppToastView(status: .default(message: "그룹 코드가 복사되었습니다"))
AppToastView(status: .error(message: "최대 7일까지 선택할 수 있어요"))
  1. ToastManager는 앱 전역에서 화면에 Toast를 표시하기 위한 싱글톤 매니저입니다.
    foregroundActive 상태의 UIWindowSecene을 참조하여, 해당 화면에 AppToast를 출력합니다.
    Toast는 Manager에서 Queue로 관리되며, dismiss시 자동으로 queue에서 삭제됩니다.
    Queue에 쌓인 순서대로 표시되며, 차례대로 표시 후 queue에서 삭제됩니다.
    사용자의 탭 인터랙션 발생 시 바로 본 화면 인터랙션이 가능하도록 토스트를 일괄 삭제합니다.
    사용법은 다음과 같습니다.
let action = UIAction(handler: {_ in 
        ToastManager.shared.showToast(status: .default(message: "그룹코드가 복사되었습니다"))
    })
let action2 = UIAction(handler: {_ in
        ToastManager.shared.showToast(status: .error(message: "최대 7일까지 선택할 수 있어요"))
    })

🔥 ScreenShot


🔥 Reference

Confluence - ToastManager

@FpRaArNkK FpRaArNkK added the Feat 새로운 기능 구현 label Feb 2, 2025
@FpRaArNkK FpRaArNkK self-assigned this Feb 2, 2025
Copy link
Contributor

@thingineeer thingineeer 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 71 to 74
$0.leading.equalTo(messageLabel).offset(-20)
$0.trailing.equalTo(messageLabel).offset(20)
$0.top.equalTo(messageLabel).offset(-12)
$0.bottom.equalTo(messageLabel).offset(12)
Copy link
Contributor

Choose a reason for hiding this comment

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

왼쪽오른쪽 위아래 값이 같다면, horizontalEdge , verticalEdge 를 써도 좋을 것 같네요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

와 맞네요 까마득하게 잊고 있었슴다 horizontal/vertical inset으로 수정해놓겠습니다!

import RxSwift
import RxCocoa

final class AppToastView: UIView {
Copy link
Contributor

Choose a reason for hiding this comment

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

토스트 메세지가 현재 뷰가 바뀌어도 유지가 되나요? 아니면 뷰가 dismiss 또는 pop 되는 순간 사라지나요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아뇨! 현재 앱에서 표시되고 있는 화면의 window에 추가되는 것이라서 UIWindow에 붙어있는 토스트라고 생각하시면 될 것 같습니다.
화면 전환 시에도 남아있게됩니다.

Copy link
Collaborator

@oyslucy oyslucy left a comment

Choose a reason for hiding this comment

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

수고하셨습니당

@FpRaArNkK FpRaArNkK merged commit f63f253 into main Feb 11, 2025
@FpRaArNkK FpRaArNkK deleted the feat/NST-62/toast branch February 11, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 새로운 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat/NST-62] 토스트 컴포넌트 개발
3 participants