Skip to content

Style/#374 공통여정 퀘스트 신고&차단 바텀시트 및 토스트메시지 추가#378

Merged
y-eonee merged 9 commits intodevelopfrom
style/#374-신고-UI
Feb 26, 2026

Hidden character warning

The head ref may contain hidden characters: "style/#374-\uc2e0\uace0-UI"
Merged

Style/#374 공통여정 퀘스트 신고&차단 바텀시트 및 토스트메시지 추가#378
y-eonee merged 9 commits intodevelopfrom
style/#374-신고-UI

Conversation

@y-eonee
Copy link
Collaborator

@y-eonee y-eonee commented Feb 23, 2026

🔗 연결된 이슈

📄 작업 내용

  • 신고하기/차단하기 & 수정하기/삭제하기 바텀시트를 구현했습니다
  • 새롭게 추가된 토스트메시지 case를 추가했고, 레이아웃을 수정했습니다.
구현 내용 시트 토스트메시지
GIF

예시로 그냥 이 뷰에서 실행해봤어요.. ㅎㅎ

💻 주요 코드 설명

바텀시트

공통여정 아카이브가 내가 작성한 퀘스트 & 남이 작성한 퀘스트 두가지로 나뉘어져서, mine과 others 라는 enum으로 구분합니다.
확장성 있게 구현해보고 싶어서 .. Item 구조체를 만들어서, 바텀시트 뷰에서 makeItem을 호출해서 뷰에 넣는 식으로 구현했습니다.

enum CommonQuestArchiveType {
    case mine
    case other
    
    struct Item {
        let title: String
        let icon: UIImage
        let color: UIColor
    }
    
    var items: [Item] {
        switch self {
        case .mine:
           ...
 override func setUI() {
        addSubviews(contentStackView, dismissButton)
        
        sheetType.items.enumerated().forEach { index, item in // item을 돌면서 하나의 item 컴포넌트를 생성합니다. 
            let rowView = makeItemRow(item: item)
            itemList.append(rowView)
            contentStackView.addArrangedSubviews(rowView)

            if index != sheetType.items.count - 1 {
                let divider = SectionDividerView()
                contentStackView.addArrangedSubviews(divider)
            }
        }
    }

이 부분에서 바텀시트를 사용할 때는 다음과 같이 부르면 됩니다!!

commonsheet.configure(sheeetTYpe: .mine) // sheet type을 정하는 configure를 먼저 호출해야합니다 
  if let sheet =  commonsheet.sheetPresentationController{
      sheet.detents = [.custom { _ in 224.adjustedH }]
      sheet.prefersGrabberVisible = true
      sheet.prefersScrollingExpandsWhenScrolledToEdge = false
      sheet.preferredCornerRadius = 8
  }
  self.present(commonsheet, animated: true)

@y-eonee y-eonee self-assigned this Feb 23, 2026
@y-eonee y-eonee linked an issue Feb 23, 2026 that may be closed by this pull request
1 task
Copy link
Collaborator

@dev-domo dev-domo left a comment

Choose a reason for hiding this comment

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

바텀시트를 만들어주심에 감사를 표합니다...

$0.spacing = 12.adjustedW
}
stackView.addArrangedSubviews(icon, label)
// stackView.snp.makeConstraints {
Copy link
Collaborator

Choose a reason for hiding this comment

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

필요없는 주석이라면 삭제해도 될 것 같습니다!

sheetType.items.enumerated().forEach { index, item in
let rowView = makeItemRow(item: item)
itemList.append(rowView)
contentStackView.addArrangedSubviews(rowView)
Copy link
Collaborator

Choose a reason for hiding this comment

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

addArrangedSubviews 대신 addArrangedSubview를 호출해도 되겠네요! 밑에 divider를 추가할 때도요!

guard let tappedView = tapRecognizer.view else { return }

switch tappedView.tag {
case 0:
Copy link
Collaborator

Choose a reason for hiding this comment

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

tag에 따라 분기 처리하기보다 만들어둔 CommonQuestArchiveType에 액션 케이스를 정의해주면 어떨까요? 대충 작성해보자면..

enum CommonQuestArchiveType {
    case mine
    case other
    
    enum Action {
        case edit, delete, report, block    // 차례대로 수정, 삭제, 신고, 차단
    }

    struct Item {
        let title: String
        let icon: UIImage
        let color: UIColor
        let action: Action    // 새로운 속성 추가
    }
    ...
}

이런 식으로 만들어서 switch-case문 없이 sheetType의 Item의 action에 접근하도록 설계할 수도 있을 것 같아요~

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

action에 접근해서 case에 따라 분기처리하는 방식으로 수정해보았습니다 !!!

@y-eonee y-eonee merged commit 53646a2 into develop Feb 26, 2026
1 check passed
@y-eonee y-eonee deleted the style/#374-신고-UI branch February 26, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Style] 신고하기 바텀시트 UI, 토스트메시지

3 participants