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

차단하기 기능 구현 #75

Merged
merged 5 commits into from
Apr 25, 2024
Merged

차단하기 기능 구현 #75

merged 5 commits into from
Apr 25, 2024

Conversation

Minny27
Copy link
Member

@Minny27 Minny27 commented Apr 23, 2024

Motivation ⍰

  • report 버튼 클릭 시, 경고창을 표시하고, 차단하면 다음 셀로 애니메이션이 적용되면서 넘어가도록 구현

Key Changes 🔑

미리보기는 다음과 같습니다.

  1. AlertController 클래스 커스텀
  • title, message, contentView, 왼쪽, 오른쪽, dim action 추가 함수 구현
  1. TimerActiveAction 추가 -> 멈추는 이벤트에 따라 케이스를 나눔
  • 프로필 더블 클릭, 다른 탭으로 이동 -> PauseView 표시하고 타이머 정지
  • report 버튼, dimView 클릭 -> PauseView 표시 안 하고 타이머 정지
  1. 차단하기 버튼 클릭 시, 다음 유저로 넘어가는 애니메이션 구현
  • 현재는 차단하기를 했을 떄, 데이터 또는 dataSource에서 item을 삭제하지 않고, 0.5초 후에 scroll하는 방식으로 구현
  • dimview를 클릭하면 타이머가 다시 시작되도록 이벤트 전달
  • reject 버튼 이벤트는 애니메이션 1초여서 1초후에 다음 유저로 넘어가도록 구현

item delete를 해서 다음 유저로 넘어가게 하고 싶은데 삭제될 아이템의 구독이 해제되지 않거나
indexPath가 1:다 로 되는 문제가 있는데 이 부분은 피드백 주시면 감사합니다.

AlertController를 커스텀했는데, 버튼이 하나 있을 때와 두 개일 때의 separatorView를 어떻게 설정하면 좋을 지 모르겠습니다.
또한, 신고하기에서 여러 버튼이 있는데 content View에 담아서 전달하는 방식으로 생각하고 있기는한데 이 부분도 어떻게 처리하면 좋을 지 피드백 주시면 감사하겠습니다.


To Reviewers 🙏🏻

  • report 버튼 클릭 시, 신고하기 > 차단하기 혹은 취소 혹은 dimView 클릭이 잘 동작하는 지 확인해주세요
  • 신고하기 클릭 시, 다음 유저로 넘어가는 애니메이션이 잘 적용되는지 확인해주세요.

Linked Issue 🔗

Minny27 added 5 commits April 23, 2024 10:14
- ReportAction enum 커스텀
- title, message, contentView, 왼쪽, 오른쪽, dim action 추가 함수 구현
- UIViewController에서 경고창 표시하는 함수 구현
- Color -> Image로 변환 함수 구현 => button에 State에 따른 색상을 넣기 위함
- addAction Custom -> button 혹은 view에서 동작 구현을 위함
- 프로필 더블 클릭, 다른 화면으로 이동할 때는 pauseView를 표시해야하고
- report 버튼을 클릭할 때는 pauseView를 표시하지 않아야 해서
- TimerActiveAction 케이스를 기준으로 Timer를 재개, 멈춤 구현
- info button tap, report button tap 합성 -> infoView를 hidden 시키는 두 가지 액션 처리
- 현재는 차단하기를 했을 떄, 데이터 또는 dataSource에서 item을 삭제하지 않고, 0.5초 후에 scroll하는 방식으로 구현
- dimview를 클릭하면 타이머가 다시 시작되도록 이벤트 전달
- reject 버튼 이벤트는 애니메이션 1초여서 1초후에 다음 유저로 넘어가도록 구현
@Minny27 Minny27 added the 🦊 Feature New feature or request label Apr 23, 2024
@Minny27 Minny27 requested review from ibcylon and ChaNoo97 April 23, 2024 03:07
@Minny27 Minny27 self-assigned this Apr 23, 2024
let updateScrollIndexTrigger = timeOverTrigger.withLatestFrom(currentIndexRelay.asDriver(onErrorJustReturn: 0)) { action, index in
switch action {
case .scroll: currentIndexRelay.accept(index + 1)
case .delete: currentIndexRelay.accept(index + 1)
Copy link
Member Author

Choose a reason for hiding this comment

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

이 부분은 셀 delete가 가능하도록 처리되면 리팩토링 하겠습니다.

targetClosure(self)
}

public func addAction(for event: UIControl.Event, closure: @escaping UIControlTargetClosure) {
Copy link
Member Author

@Minny27 Minny27 Apr 23, 2024

Choose a reason for hiding this comment

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

Rx를 안 쓴 이유는 DSKit이 RxSwift를 의존하면 안 된다고 잘못 생각하고 있었네요..

UIView나 UIButton에 클로저를 전달해서 액션 추가를 직접 해볼 수 있어서 재밌었습니다.

Copy link
Member

@ibcylon ibcylon left a comment

Choose a reason for hiding this comment

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

고생하셨습니다. 애니메이션 넣으니까 훨씬 좋아보이네요.

@Minny27
Copy link
Member Author

Minny27 commented Apr 25, 2024

추후에 셀 삭제 시에 모델과 셀 둘 다 delete하는 방향으로 리팩토링하겠습니다!

@Minny27 Minny27 merged commit 6f4e859 into main Apr 25, 2024
@Minny27 Minny27 deleted the Feature/user_complaint_block branch April 25, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦊 Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants