Skip to content

DesignSystem 모듈 분리 및 구조 정리#313

Merged
pinocchio22 merged 6 commits intodevfrom
feat/#306-MLSDesignSystem-Module
Apr 7, 2026
Merged

DesignSystem 모듈 분리 및 구조 정리#313
pinocchio22 merged 6 commits intodevfrom
feat/#306-MLSDesignSystem-Module

Conversation

@pinocchio22
Copy link
Copy Markdown
Contributor

@pinocchio22 pinocchio22 commented Apr 4, 2026

1. 모듈 구조 설계

DesignSystem은 Presentation 레이어에서 사용되는 순수 UI 요소만 관리하는 모듈로 구성했습니다.

MLSDesignSystem
 └─ Sources
    └─ MLSDesignSystem
       ├─ Components   : 최소 단위 UI 컴포넌트
       ├─ Layouts      : 여러 컴포넌트를 조합한 공통 View
       ├─ Factory      : UI 표시용 Factory (Toast, Snackbar 등)
       ├─ Resources    : Asset / Font / Image 등 리소스
       └─ Utils        : UI 사용을 돕는 Helper 및 Extension

DesignSystem은 앱 구조 요소를 포함하지 않고 순수 UI 모듈로 유지하는 것을 목표로 합니다.

2. 역할 재정의

기존 DesignSystem과 BaseFeature에는 다음과 같은 요소들이 포함되어 역할이 모호했습니다.

  • TabBar 관련 구현
  • BaseViewController
  • 일부 인프라 의존 코드 (ImageLoader 등)

이를 해결하기 위해 각 모듈의 역할을 다음과 같이 재정의했습니다.

DesignSystem

  • UI Components
  • 공통 Layout View
  • UI Factory (Toast, Snackbar 등)
  • Font / Color / Image 리소스
  • UI Extension
    → 순수 UI 모듈

3. 공용 View 이전

기존 Base 모듈에 위치하던 공통 View들을 DesignSystem으로 이전했습니다.

이전 기준:

  • UI 구성 요소
  • 여러 Feature에서 재사용
  • Presentation 레이어에서 공통 사용

이 기준에 맞는 View만 DesignSystem에 포함하도록 정리했습니다.

4. 의존성 방향

정리된 의존성 구조는 다음과 같습니다.

Presentation → DesignSystem
Presentation → Core

DesignSystem은 다른 모듈에 의존하지 않으며,
단방향 UI 의존성만 유지하도록 구성했습니다.

5. 의존성 제거 작업

1. SnackbarFactory → ImageLoader 의존 제거

기존

  • DesignSystem 내부에서 ImageLoader 직접 사용

문제

  • UI 모듈이 Core 모듈에 의존

수정

  • ImageLoader 외부 주입 방식으로 변경
  • DesignSystem 내부 직접 의존 제거

→ UI 모듈 순수성 유지

2. BaseViewController → CustomTabBar 의존 제거

문제

  • BaseViewController가 TabBar 구현에 의존
  • 모듈 간 순환 의존성 가능성 발생

수정

  • BaseViewController에서 CustomTabBar 의존 제거

6. SPM 리소스 접근 방식 변경

SPM 모듈 분리로 인해 Asset 접근 방식이 변경되었습니다.

기존

UIImage.check
UIImage(named: "check")

변경

DesignSystemAsset.image(.check)

SPM 번들 리소스 접근을 위해 Asset Helper를 추가하고
기존 UIImage 직접 접근 코드를 수정했습니다.

결론

  • DesignSystem을 순수 UI 모듈로 정리
  • 공통 인프라는 Core 모듈로 분리
  • UI 모듈에서 Core 모듈 의존성 제거
  • 필요한 기능은 외부 주입 방식으로 변경
  • PS: BaseViewController에서 탭바를 숨기기위해 UIViewController extension을 이용하는데 이러면 Core에 위치하지만 UIKit이 필요.. 올바른 구조가 맞는지 논의가 필요할듯..

1. 기존 DesignSystem -> MLSDesignSystem
2. BaseFeature의 SharedView 이전
3. 디자인 컴포넌트 + 공용뷰 + 디자인 팩토리 + Utils
4. 각 Feature에서 UI관련하여 해당 모듈을 의존
5. UIImage 직접접근 코드 수정
6. @mainactor 설정
@pinocchio22 pinocchio22 requested a review from dongglehada April 4, 2026 08:34
@pinocchio22 pinocchio22 self-assigned this Apr 4, 2026
@pinocchio22 pinocchio22 added feat 새로운 기능을 추가 fix 버그 수정, 잔잔바리 수정, 병합 시 충돌 해결 labels Apr 4, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new example application, MLSDesignSystemExample, to demonstrate and test various UI components within the MLSDesignSystem framework. The changes include the addition of numerous test view controllers for components such as badges, cards, and buttons, along with the necessary project configuration updates. Feedback identifies a typo in the project's tool version setting and an inconsistent module import in the main view controller. Additionally, the reviewer suggests addressing architectural inconsistencies regarding the BottomTabBarController dependency and cleaning up commented-out code within the newly added test files to improve maintainability.

BaseViewController를 Core 모듈로 옮기고 TabbarController 직접참조를 제거하여  DesignSystem의 의존성을 분리
Copy link
Copy Markdown
Member

@dongglehada dongglehada left a comment

Choose a reason for hiding this comment

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

수고하셨습니다! 모듈 설계 방향 자체는 좋다고 생각합니다. DesignSystem 순수 UI 모듈로 정리한 거랑 외부 주입 방식으로 변경한 부분 특히 동의해요 👍

PS에 언급하신 UIViewController extension 위치 관련해서는 제가 이해가 조금 부족해서 구두로 설명 부탁드려도 될까요?

@pinocchio22 pinocchio22 linked an issue Apr 6, 2026 that may be closed by this pull request
@pinocchio22
Copy link
Copy Markdown
Contributor Author

pinocchio22 commented Apr 6, 2026

BaseViewController에서 탭바 숨김 처리를 공통으로 제공하기 위해 CustomTabBarController 타입을 직접 참조하고 있었고, 이로 인해 Core 모듈이 UI 구현을 알게 되는 의존성 문제가 발생했습니다
이를 해결하기 위해 UIViewController extension에 인터페이스 형태로 정의하고 CustomTabBarController에서 구체 구현하는 방식을 고려했습니다
하지만 이 방식 또한 Core 모듈에 UIKit 기반 확장이 포함되면서 Core가 순수 비즈니스 로직을 담당한다는 책임과 맞지 않는다고 판단했습니다
따라서 BaseViewController에서 탭바 제어 책임을 제거하고, 각 Feature(ViewController)에서 필요한 경우 직접 탭바 숨김 처리를 수행하는 구조로 변경했습니다!!

  • 구두로는 회의때 전달 드리겠습니다 :)

@dongglehada dongglehada self-requested a review April 7, 2026 04:14
@pinocchio22 pinocchio22 merged commit a0db594 into dev Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 새로운 기능을 추가 fix 버그 수정, 잔잔바리 수정, 병합 시 충돌 해결

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DesignSystem 모듈을 구성합니다.

2 participants