-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: 신고 삭제 로직 분리 #298
chore: 신고 삭제 로직 분리 #298
Conversation
private let defaultPostManagerEndPointFactory: PostManagerEndPointFactory | ||
private let defaultPostEndPointFactory: PostEndPointFactory | ||
private let defaultUserEndPointFactory: UserEndPointFactory | ||
|
||
// MARK: - Methods | ||
|
||
init(provider: ProviderType = Provider(), defaultPostManagerEndPointFactory: PostManagerEndPointFactory = DefaultPostManagerEndPointFactory(), defaultPostEndPointFactory: PostEndPointFactory = DefaultPostEndPointFactory(), defaultUserEndPointFactory: UserEndPointFactory = DefaultUserEndPointFactory()) { | ||
init(provider: ProviderType = Provider(), authManager: AuthManagerProtocol = AuthManager.shared, defaultPostManagerEndPointFactory: PostManagerEndPointFactory = DefaultPostManagerEndPointFactory(), defaultPostEndPointFactory: PostEndPointFactory = DefaultPostEndPointFactory(), defaultUserEndPointFactory: UserEndPointFactory = DefaultUserEndPointFactory()) { |
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.
줄바꿈을 하면 좀 더 가독성이 좋아질 것 같습니다.
@@ -16,7 +16,7 @@ final class PlaybackCell: UICollectionViewCell { | |||
|
|||
weak var delegate: PlaybackViewControllerDelegate? | |||
|
|||
private var memberID: Int? | |||
private (set) var memberID: Int? |
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.
이 값은 Interactor내에서만 관리가 불가능한가요?
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.
셀마다 memberID가 바뀌어서요. 셀과 현재 유저의 memberID비교를 위해서는 필요할 것 같네요.
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.
궁금한 점은 PlaybackCell의 인덱스와 Interactor의 Post가 인덱스 순서 동기화는 전혀 안되는 건가요? 무한스크롤 때문인지
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.
안 될건 없...죠? cell의 indexPath와 post index 비교해서 찾으려 하시는 건가용
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.
네 맞아요, view 인만큼 view와 관련이 없는 값들은 view가 몰라야 한다고 생각해서요.
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.
음 그러면 interactor에서도 셀이랑 포스트들 동기화 시켜서 배열 하나 가지고 있어야겠네용. 한 번 고민해보겠습니다!
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.
넹 그렇게 하셔서 state를 Interactor가 가지게 하면 좋을 것 같습니다. MVVM 패턴에서도 그런 방식으로 ViewModel이 State를 소유하는 구조로 알고 있어서요!
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.
저도 가장 멍청해야할 뷰가 모델을 알고있는 느낌이라
가능하다면 cell 내부보다는 interactor에서 id를 관리하는 것이 좋을 것 같다고 생각되네요 !
@@ -179,7 +179,7 @@ enum PlaybackModels { | |||
} | |||
|
|||
struct Response { | |||
let parentView: ParentView | |||
let buttonType: ButtonType |
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.
ButtonType의 description을 CustomStringConvertible을 채택하는건 어떨까요
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.
고생하셨습니다~~
guard let worker, | ||
let currentCellMemberID: Int = previousCell?.memberID | ||
else { return } | ||
let buttonType: Models.SetSeemoreButton.ButtonType = worker.isMyVideo(currentCellMemberID: currentCellMemberID) ? .delete : .report |
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.
👍👍👍
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.
인환님이 코멘트를 잘 남겨주셔서 딱히 말씀드릴 건 없는 것 같습니다 !!
수고수고링 (새벽에 죄송..)
그리고 제 게시물 신고하지 말아주세요 흑흑 |
🧑🚀 PR 요약
�authManager에서 memberID가져와 비교해 본인 것이면 삭제, 다른 사람 것이면 신고가 되도록 했습니다.
📸 ScreenShot
default.mov
Linked Issue
close #295