Skip to content

Conversation

@JinUng41
Copy link
Collaborator

👻 PULL REQUEST

📄 작업 내용

  • WableBottomSheet을 구현하였습니다.
  • WableActionSheet 코드를 수정하였습니다. (UIAlertController 코드를 참고)
구현 내용 iPhone 13 mini
GIF

💻 주요 코드 설명

Wable Sheet 코드 사용법

  • 애플 시스템 액션 시트를 참고하여 구현하였습니다.
  • UIAlertController에서 액션을 추가할 때, addAction을 이용하여 구현하는 것처럼 WableSheet도 구현하였습니다.
  • 아요 개발자에게 보다 익숙한 방식이지 않을까 싶어 이러한 방식을 차용하였습니다.
WableSheetController.swift / WableBottomSheetController.swift
// MARK: - WableSheetController

extension WableSheetViewController {
    func addAction(_ action: WableSheetAction) {
        let button = createWableButton(for: action)
        buttonStackView.addArrangedSubview(button)
    }
    
    func addActions(_ actions: WableSheetAction...) {
        actions.forEach { addAction($0) }
    }
}

// MARK: - WableBottomSheetController

extension WableBottomSheetController {
    func addAction(_ action: WableBottomSheetAction) {
        let buttonAction = UIAction { [weak self] _ in
            self?.dismissWithAnimation(completion: action.handler)
        }
        
        let button = UIButton().then {
            $0.setAttributedTitle(action.title.pretendardString(with: .body1), for: .normal)
            $0.setTitleColor(.wableBlack, for: .normal)
            $0.addAction(buttonAction, for: .touchUpInside)
        }
        button.snp.makeConstraints { make in
            make.adjustedHeightEqualTo(Constant.buttonHeight)
        }
        
        buttonStackView.addArrangedSubview(button)
    }
    
    func addActions(_ actions: WableBottomSheetAction...) {
        actions.forEach { addAction($0) }
    }
}

🔗 연결된 이슈

- 생성자에서 주입되어야 하는 내용 간결화 (타이틀과 메세지만 주입)
- UIAlertController 처럼 addAction하여 액션 및 버튼을 추가하는 형태로 구현
@JinUng41 JinUng41 added ✨ feat 기능 또는 객체 구현 ♻️ refactor 기존 코드를 리팩토링하거나 수정하는 등 사용 (생산적인 경우) 🍻 진웅 술 한잔 가온나~ labels Mar 17, 2025
@JinUng41 JinUng41 added this to the 리팩토링 마감 milestone Mar 17, 2025
@JinUng41 JinUng41 requested a review from youz2me March 17, 2025 15:18
@JinUng41 JinUng41 self-assigned this Mar 17, 2025
@JinUng41 JinUng41 moved this to Ready for Review in Wable-iOS Mar 17, 2025
Copy link
Member

@youz2me youz2me left a comment

Choose a reason for hiding this comment

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

고생스기루!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!이제잡시다

Comment on lines +56 to +57
modalTransitionStyle = .crossDissolve
modalPresentationStyle = .overFullScreen
Copy link
Member

Choose a reason for hiding this comment

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

💯

@github-project-automation github-project-automation bot moved this from Ready for Review to In Review in Wable-iOS Mar 17, 2025
@JinUng41 JinUng41 merged commit df3d576 into develop Mar 17, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in Wable-iOS Mar 17, 2025
@JinUng41 JinUng41 deleted the feat/#124-bottom-sheet branch March 17, 2025 16:30
youz2me pushed a commit that referenced this pull request Oct 26, 2025
[Feat] 와블 바텀 시트 구현 및 액션 시트 코드 수정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 기능 또는 객체 구현 ♻️ refactor 기존 코드를 리팩토링하거나 수정하는 등 사용 (생산적인 경우) 🍻 진웅 술 한잔 가온나~

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feat] 와블 바텀 시트 구현 및 액션 시트 구현 수정

3 participants