Skip to content

Conversation

@yurim830
Copy link
Collaborator

@yurim830 yurim830 commented Jul 15, 2025

🐿️ Pull Requests

🪵 작업 브랜치

🥔 작업 내용

  • 장소 등록 프로세스 뼈대를 구현해봤습니다. 혹시 더 좋은 구조 아이디어가 있다면 말씀해주세요!

  • 페이지를 만들 때 BaseUploadInquiryVC를 상속받으면 됩니다.

    • contentViews 프로퍼티를 오버라이딩하여 UI 프로퍼티 배열을 넣으면 자동으로 노란색 contentView에 addSubView 됩니다. spotUploadInquiryView.contentView.addSubviews(...)를 반복하는 게 길고 번거로워서 이렇게 오버라이딩 프로퍼티로 만들었습니다.
    • super.init 부분에서 requirement, title, caption은 페이지 제목 섹션에 해당합니다.
// 적용 예시
class SpotTypeSelectionViewController: BaseUploadInquiryViewController {
    private let restaurantButton = UIButton()
    private let cafeButton = UIButton()

    override var contentViews: [UIView] { // <- 오버라이딩
        [restaurantButton, cafeButton]
    }

    init(_ viewModel: SpotUploadViewModel) { 
        super.init(viewModel: viewModel,
                   requirement: .required, // 필수질문 여부
                   title: StringLiterals.SpotUpload.isThisRestaurantOrCafe, // 질문 제목
                   caption: StringLiterals.SpotUpload.brunchIsCafe) // 회색 캡션 (optional)
    }

    override func setLayout() { // <- `setHierarchy` 건너뛰고 바로 레이아웃 지정
        restaurantButton.snp.makeConstraints {
            ...
    }

    override func setStyle() {
        // 스타일 지정
    }

참고: SpotUploadSearchViewController, SpotTypeSelectionViewController

  • 뷰 구조는 그림으로 정리하면 이렇습니다.

🚨 참고 사항

뒤로가기 버튼에서 borderGlassmorphismType을 설정하면 아래 사진처럼 버튼이 네모낳게 이상해지는 이슈가 있습니다..
탈퇴 뷰 모달 코드랑 똑같이 해봐도 그러네요... 추후 디버깅해보겠습니다. 일단은 일반 glassmorphismType으로 설정해뒀어요
문제코드: let previousButton = ACButton(style: GlassButton(borderGlassmorphismType: .buttonGlassDefault, buttonType: .line_22_b1SB), title: StringLiterals.SpotUpload.goPrevious)

image

📸 스크린샷

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-07-16.at.05.22.53.mp4

💥 To be sure

  • 모든 뷰가 잘 실행되는지 다시 한 번 체크해주세요 !

🌰 Resolve issue

@cirtuare cirtuare self-requested a review July 16, 2025 13:18
Copy link
Contributor

@cirtuare cirtuare left a comment

Choose a reason for hiding this comment

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

진짜 최고 !!!!!! 💗🥑 잘 쓰겠습니당
PR 컨벤션만 바꿔줘잉 ~~

155D45B02E26B2E3008C0316 /* SpotUploadSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotUploadSearchViewController.swift; sourceTree = "<group>"; };
155D45B22E26B8CB008C0316 /* BaseUploadInquiryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseUploadInquiryView.swift; sourceTree = "<group>"; };
155D45B52E26BB5F008C0316 /* RequirementType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequirementType.swift; sourceTree = "<group>"; };
155D45B72E26CCBC008C0316 /* BaseUploadInquiryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseUploadInquiryViewController.swift; sourceTree = "<group>"; };
Copy link
Contributor

Choose a reason for hiding this comment

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

🐿️🐿️
SpotUpload > View 그룹 안에 Base 그룹 하나 더 만들어서 폴더링 하는 거 어떨까요?! 뷰랑 뷰컨이 엄청 많을 것 같아서, Base라도 분리하면 좋을 것 같아요!

Copy link
Contributor

Choose a reason for hiding this comment

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

SpotUpload / BaseUploadInquiry / Pages 이렇게 폴더링하는 건 어떨까요 👀

Comment on lines 78 to 84
viewModel.isPreviousButtonEnabled.value = true

if viewModel.spotType != nil {
viewModel.isNextButtonEnabled.value = true
} else {
viewModel.isNextButtonEnabled.value = false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🐿️🐿️
이거 BaseUploadInquiryVC으로 빼면 좋을 것 같아요! previousButton은 init에서 값 받고, nextButton도 바인딩 주체를 init에서 받으면 setStyle에서 제어할 수 있지 않을까 싶네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

좋은 방향 제안해주셔서 감사합니다!!
그런데 init에서 바인딩하자니, 너무 무거워지는 느낌이라 연산 프로퍼티를 오버라이딩 하는 방식으로 수정해봤습니다!

BaseUploadInquiryVC에 canGoPrevious, canGoNext 연산프로퍼티와 updateButtonState 메소드를 추가했고

    var canGoPrevious: Bool { true }
    var canGoNext: Bool { false }

    func updateButtonStates() {
        viewModel.isPreviousButtonEnabled.value = canGoPrevious
        viewModel.isNextButtonEnabled.value = canGoNext
    }

ChildVC에서 canGoPrevious, canGoNext 를 오버라이딩하여 viewModel.spotType != nil 등과 같은 판단 로직을 넣는 방향으로 수정했습니다!

@yurim830 yurim830 changed the title [Feature/#227] 장소 등록 프로세스 뼈대 구현 (페이징, BaseVC) [Feature] 장소 등록 프로세스 뼈대 구현 (페이징, BaseVC) (#227) Jul 16, 2025
@cirtuare cirtuare changed the title [Feature] 장소 등록 프로세스 뼈대 구현 (페이징, BaseVC) (#227) [FEAT] 장소 등록 프로세스 뼈대 구현 (페이징, BaseVC) (#227) Jul 17, 2025
@yurim830 yurim830 self-assigned this Jul 17, 2025
@yurim830 yurim830 added 🌀 feature 새로운 기능 개발 🥑 유림 유림 labels Jul 17, 2025
@yurim830 yurim830 merged commit b5d93be into develop Jul 17, 2025
@yurim830 yurim830 added this to the Sprint - 4 milestone Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌀 feature 새로운 기능 개발 🥑 유림 유림

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 장소 등록 프로세스 뼈대 구현

3 participants