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

토스트 디자인 구현 #126

Merged
merged 12 commits into from
Mar 24, 2024
Merged

토스트 디자인 구현 #126

merged 12 commits into from
Mar 24, 2024

Conversation

WhiteHyun
Copy link
Member

@WhiteHyun WhiteHyun commented Mar 24, 2024

Screenshots 📸

시연 영상
RPReplay_Final1711267014



고민, 과정, 근거 💬

  • 토스트 뷰를 추가했습니다.
  • 나중에 값 확인 또는 사용자에게 경고를 요청할 때 사용하기 위함으로 구현했습니다.
  • 테스트를 위해 별도의 App Target을 추가했습니다. 앞으로 디자인시스템 테스트할 때 해당 Target을 사용하시면 될 것 같아요. :)

사용방법은 아래와 같습니다.

Toast.shared.present(title: "Airpods Pro", symbol: "airpodspro", isUserInteractionEnabled: true)
  • title: 토스트 제목
  • symbol: 토스트에 들어갈 SF Symbol 이미지 문자열 값
  • tint: 토스트의 틴트 색상
  • isUserInteractionEnabled: 사용자의 상호작용 여부, 스스로 지우거나 못하도록 설정할 수 있습니다.
  • duration: 토스트 유지 시간

@WhiteHyun WhiteHyun linked an issue Mar 24, 2024 that may be closed by this pull request
1 task
Added ToastItem struct with custom properties and Timing enum for toast item
Added ToastView struct for displaying toast item with symbol image and title
Added ToastGroup struct for managing multiple toast views in a ZStack
Added RootView struct for setting up UIWindow for overlay window to display toast
Added Toast class with present method to add toast items to display on RootView
@WhiteHyun WhiteHyun self-assigned this Mar 24, 2024
@WhiteHyun WhiteHyun added the 🔨 Implementation New feature or request label Mar 24, 2024
@WhiteHyun WhiteHyun added this to the v2.0.0 milestone Mar 24, 2024
@WhiteHyun WhiteHyun changed the title ✨ Add ToastItem, ToastView, ToastGroup, RootView, and Toast classes 네트워크 연결 장애 시 토스트 띄움 Mar 24, 2024
The commit updates file references in DesignSystemApp with correct file names
and adds DesignSystem as a package product dependency.
Add animation properties and methods to animate the toast view in and out.
Also, add functionality to remove the toast item from the list after it's hidden.
- Add animation to the process of appending new toast items to provide a smooth
visual transition. Implement a dismissal gesture for toast items, where a
swipe downwards of over 100 points removes the displayed toast item.
Changed the variable name `isUseInteractionEnabled` to `isUserInteractionEnabled` for
consistency. Added a guard statement in gesture handling to prevent
interactions when `isUserInteractionEnabled` is false.
- Set toast view z-index based on toast id
- Add transition animation for toast removal
- Simplify toast removal logic
Introduce a DispatchWorkItem to delay the removal of toast items based on
item duration, preventing abrupt dismissal of toasts.
@WhiteHyun WhiteHyun changed the title 네트워크 연결 장애 시 토스트 띄움 토스트 디자인 구현 Mar 24, 2024
@WhiteHyun WhiteHyun requested a review from a team March 24, 2024 07:57
Copy link
Contributor

@eung7 eung7 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 디자인이 너무 예쁘네요!

@eung7 eung7 merged commit 963a5d7 into main Mar 24, 2024
2 checks passed
@eung7 eung7 deleted the feature/ui/124 branch March 24, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 Implementation New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

[Feat]: Hero Effect / Custom Toast
2 participants