-
Notifications
You must be signed in to change notification settings - Fork 5
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
Toast Message 구현 [SwiftUI] #161
Conversation
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.
수고하셨습니다! 👍
/// Toast Message: 기록 시작! | ||
case Toast_Text_NewRecord |
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.
P3 (반영 고민)
TLRKey 의 주석은 한글로 어떤값인지를 나타내고 있었어요!
기존 방식이라면 "기록 시작!" 내용이여야 합니다
확인이 필요할 것 같아요!
translatesAutoresizingMaskIntoConstraints = false | ||
NSLayoutConstraint.activate([ | ||
centerXAnchor.constraint(equalTo: window.centerXAnchor), | ||
topAnchor.constraint(equalTo: window.safeAreaLayoutGuide.topAnchor) | ||
]) |
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.
P4 (참고)
self.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
self.centerXAnchor.constraint(equalTo: window.centerXAnchor),
self.topAnchor.constraint(equalTo: window.safeAreaLayoutGuide.topAnchor)
])
]) | ||
} | ||
|
||
NotificationCenter.default.addObserver(forName: Notification.Name("updatedIsPresenting"), object: nil, queue: nil) { [weak self] notification in |
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.
P4 (참고)
Notification.Name 은 한곳에서 관리되면 어떨까요?
Notification+Extension 파일에 추가하는것도 고려해보면 좋을 것 같습니다!
if presenter.isPresenting { | ||
toast?.view.removeFromSuperview() | ||
presenter.isPresenting = false | ||
} |
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 (꼭 확인)
toast가 표시되어 있는데 toast를 표시하고자 하는 경우에 속하는 것 같아요
그때 기존 toast를 제거하고 표시하고자 하는 것으로 보이는데, 올바른 UX가 아닌 것 같아요!
개인 의견으로는 Toast 대기열, 또는 Toast 위에 Toast 표시 등의 방법이 더 좋을 것 같습니다
논의가 필요해 보여요!
self.toast = toast | ||
} | ||
|
||
guard let toastView = self.toast?.view else { return } |
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 (꼭 반영)
guard 문은 최상위로 올려주세요!
예상치 못한 경우 hostingViewController가 설정되었는데 표시가 안되는 상황이 발생할 수 있을 것 같습니다!
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.
이해를 못했습니다
self.toast = toast를 하기전에는 guard문이 무조건 return을 하게 될텐데 의도하시는 동작이 어떤걸까요 ??
@@ -0,0 +1,22 @@ | |||
// | |||
// ToastData.swift |
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.
P4 (참고)
ToastPresenter
@@ -27,4 +27,6 @@ enum Colors { | |||
static let placeholderGray = UIColor(named: "placeholderGrayColor")! | |||
static let firstBackground = UIColor(named: "firstBackgroundColor")! | |||
static let wrongTextField = UIColor(named: "wrongTextFieldColor")! | |||
|
|||
static let ttPrimary = UIColor(named: "primary")! |
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 (꼭 확인)
Figma 상에서 앞으로 관리되는 컬러값은 프로퍼티명이 동일했으면 좋겠습니다!
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.
primary는 iOS에서 제공하는 기본 컬러값이 있기 때문에 tt를 prefix로 붙였습니다
이 부분을 통일하려면 디자인 쪽에서 수정하는게 좋을것 같습니다! 회의때 얘기해보시죵
개요
구현 내용
1.
ToastMessage
동작2. UIKit에서 사용 가능한
ToastMessage
4.
ToastViewProtocol
내부에 보여질 컨텐츠는
ToastViewProtocol
을 채택한 객체로 Custom할 수 있도록 구현했습니다.5.
ToastPresenter
ToastMessage
에서 중복되는 Toast를 관리하기 위해 사용하고 있습니다.ScreenShot
RPReplay_Final1719851353.mov