Skip to content

Design/#4 ds kit setting#7

Merged
ChoiAnYong merged 13 commits into
developfrom
design/#4-DSKit_Setting
Jan 21, 2026
Merged

Design/#4 ds kit setting#7
ChoiAnYong merged 13 commits into
developfrom
design/#4-DSKit_Setting

Conversation

@ChoiAnYong
Copy link
Copy Markdown
Contributor

@ChoiAnYong ChoiAnYong commented Jan 21, 2026

🔗 연결된 이슈

📄 작업 내용

  • 폰트 설정
  • 색상 설정
  • 아이콘 추가
구현 내용 IPhone 16 pro
GIF

💻 주요 코드 설명

UIFont+.swift

  • UIFont Extension 해서 NDGL Enum 만들고 폰트, 행간, 자간 설정했습니다.
  • 행간 자간 적용을 위해 attributes를 사용하도록 했습니다.
extension UIFont {
    public enum NDGL {
        // Titles
        case titleLB // 행간 140%, 자간 -2.5%
        // 생략
        private var font: UIFont {
            switch self {
            case .titleLB:
                return DSKitFontFamily.Pretendard.bold.font(size: 32)
                // 생략
            }
       }
    }
}

extension UIFont.NDGL {
    private var lineHeightMultiple: CGFloat {
        switch self {
        // Titles
        case .titleLB, .titleLSB, .titleMB, .titleMSB:
            return 1.4
        //생략
        }
    }
    
    private var kern: CGFloat {
        switch self {
        case .titleMB, .titleMSB:
            return -0.02
        //생략
        }
    }
    
    public var attributes: [NSAttributedString.Key: Any] {
        let paragraphStyle = NSMutableParagraphStyle()
        let targetHeight = font.pointSize * lineHeightMultiple
        
        paragraphStyle.minimumLineHeight = targetHeight
        paragraphStyle.maximumLineHeight = targetHeight
        
        let baselineOffset = (targetHeight - font.lineHeight) / 2

        return [
            .font: font,
            .kern: font.pointSize * kern,
            .paragraphStyle: paragraphStyle,
            .baselineOffset: baselineOffset
        ]
    }
}

UIColor+.swift

  • UIColor Extension 해서 NDGL Enum 만들고 디자인 시스템에 있는 형식으로 분류했습니다.
extension UIColor {
    public enum NDGL {
        public enum Text {
            public static let primary = DSKitAsset.Colors.gray900.color
            public static let secondary = DSKitAsset.Colors.gray700.color
            public static let tertiary = DSKitAsset.Colors.gray500.color
            public static  let danger = DSKitAsset.Colors.red600.color
            public static let disabled = DSKitAsset.Colors.gray400.color
                
            public enum Interactive {
                public static let primary = DSKitAsset.Colors.primary500.color
                public static let primaryHovered = DSKitAsset.Colors.primary600.color
                public static let primaryPressed = DSKitAsset.Colors.primary700.color
                public static let secondary = DSKitAsset.Colors.gray600.color
                public static let secondaryHovered = DSKitAsset.Colors.gray700.color
                public static let secondaryPressed = DSKitAsset.Colors.gray800.color
                public static let inverse = DSKitAsset.Colors.baseWhite.color
            }
        }
        // 생략
}

✏️ 사용 방법 설명

  • 폰트 및 색상
        titleLB.do {
            $0.setText(.titleLB, text: "기본 초기화", color: .NDGL.Text.primary)
            $0.backgroundColor = .yellow
        }
        
        titleLSB.do {
            $0.setText(.titleLB, text: "색상 변경 초기화", color: .NDGL.Text.primary)
            $0.changeColor(.NDGL.Text.danger)
            $0.backgroundColor = .yellow
        }
        
        titleMB.do {
            $0.setText(.titleLB, text: "글자 변경", color: .NDGL.Text.Interactive.primaryPressed)
            $0.updateText("변경된 글자")
            $0.backgroundColor = .yellow
        }
  • 아이콘
private let image = UIImageView(image: DSKitAsset.Assets.icAirplane1.image)

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 통일된 색상 시스템(NDGL) 추가 - 텍스트, 배경, 아이콘, 보더에 대한 일관된 색상 팔레트 및 상호작용 상태
    • 타이포그래피 시스템(NDGL) 추가 - 제목, 부제목, 본문 스타일의 통합 글꼴 관리
    • 50개 이상의 새로운 아이콘 자산 추가
    • UIColor와 UILabel 유틸리티 메서드 추가
  • Chores

    • 린트 규칙 및 코드 스타일 설정 업데이트
    • DSKit 모듈에 리소스 통합

✏️ Tip: You can customize this high-level summary in your review settings.

@ChoiAnYong ChoiAnYong requested a review from KimNahun January 21, 2026 07:54
@ChoiAnYong ChoiAnYong self-assigned this Jan 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 21, 2026

Walkthrough

디자인 시스템 모듈(DSKit)을 설정하며 색상 에셋, 아이콘 에셋, 폰트 시스템을 추가하고, UIColor와 UILabel 확장 메서드를 구현했습니다. 빈 플레이스홀더 파일도 제거했습니다.

Changes

Cohort / File(s) Summary
SwiftLint 설정
\.swiftlint\.yml
nesting, function_body_length 규칙 비활성화, 명시적 line_length 임계값 설정, type_name 최소/최대 길이 제약 강화
DSKit 모듈 기본 설정
Projects/Modules/DSKit/Project\.swift
프레임워크 타겟의 hasResources 플래그를 true로 변경하여 리소스 포함 활성화
색상 에셋 메타데이터
Projects/Modules/DSKit/Resources/Colors\.xcassets/*/Contents\.json
Primary(primary50900), Red(red50900), Secondary(gray50~900), baseWhite 컬러셋에 대한 asset catalog 메타데이터 추가 (총 45개 파일, 각 20줄)
아이콘 에셋 메타데이터
Projects/Modules/DSKit/Resources/Assets\.xcassets/*/Contents\.json
ic_airplane1, ic_bag1, ic_book1, ic_bus12, ic_car13, ic_card1, ic_chevron_*, ic_clock12, ic_close1, ic_coffee12, ic_edit12, ic_flag12, ic_home13, ic_magic1, ic_map1, ic_menu12, ic_phone1, ic_piggybank1, ic_pin1, ic_plus12, ic_refresh1, ic_restaurant12, ic_search12, ic_settings1, ic_share1, ic_sliders1, ic_star12, ic_star_fill1, ic_tool1, ic_train12, ic_trash1, ic_tv1, ic_video1, ic_walk12 imageset 메타데이터 (총 65개 파일, 각 12줄)
빈 플레이스홀더 파일 제거
Projects/Modules/DSKit/Sources/DSEmpty\.swift, Projects/Core/Sources/Extensions/UIKit+/Empty\.swift
콘텐츠 없는 placeholder 파일 삭제
Core UIColor 확장
Projects/Core/Sources/Extensions/UIKit+/UIColor+\.swift
16진수 문자열(#RRGGBB)과 알파값으로 UIColor를 초기화하는 public 편의 생성자 추가
Core UILabel 확장
Projects/Core/Sources/Extensions/UIKit+/UILabel+\.swift
updateText(_:) (텍스트 속성 보존), changeColor(_:) (색상만 변경) 메서드 추가
DSKit UIColor 확장(디자인 시스템)
Projects/Modules/DSKit/Sources/Extensions/UIKit+/UIColor+\.swift
UIColor.NDGL 네임스페이스 아래 Text, Bg, Icon, Border 그룹의 색상 상수 추가 (각 그룹마다 기본 + Interactive 서브셋 포함)
DSKit UIFont 확장(타이포그래피)
Projects/Modules/DSKit/Sources/Extensions/UIKit+/UIFont+\.swift
UIFont.NDGL 타이포그래피 시스템 추가: 제목, 부제목, 본문 스타일 정의, Pretendard 폰트 매핑, 속성 계산(line-height, kerning, baseline offset)
DSKit UILabel 확장(타이포그래피 적용)
Projects/Modules/DSKit/Sources/Extensions/UIKit+/UILabel+\.swift
setText(_:text:color:alignment:) 메서드: NDGL 스타일로 텍스트 속성 설정 및 색상, 정렬 적용

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

이유: 변경사항의 대부분이 반복적인 에셋 메타데이터 파일(~110개)이며, 코드 변경은 직관적인 유틸리티 확장 메서드들로 구성되어 있습니다. 각 소스 파일은 선형적 로직을 따르고 의존성이 명확합니다.

Poem

🐰 에셋 속에 색과 아이콘 담겨
폰트와 색상 시스템 정려
타이포그래피로 디자인 빛나고
UILabel 확장으로 손쉽게 입히네
디자인 시스템, 이제 완성이라! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 'Design/#4 ds kit setting'으로 간단하지만 주요 변경사항(디자인 시스템 설정)을 반영합니다.
Description check ✅ Passed PR 설명이 템플릿을 따르며 연결된 이슈, 작업 내용, 코드 설명, 사용 방법 등을 포함하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 변경사항이 #4의 목표를 만족합니다: 색상 에셋 추가(Primary, Red, Secondary 색상팔레트), 아이콘 에셋 추가(50+ 아이콘), 폰트 설정(UIFont.NDGL).
Out of Scope Changes check ✅ Passed 모든 변경사항이 #4 이슈의 범위 내입니다: 폰트 설정, 색상 에셋, 아이콘 추가, UIColor/UIFont 헬퍼 메서드, SwiftLint 설정 조정.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 13

🤖 Fix all issues with AI agents
In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_bus1.imageset/Contents.json`:
- Line 4: Contents.json lists the asset file as "ic_bus 1.svg" which contains a
space and does not match the asset folder name ic_bus1.imageset; rename the
actual asset file to "ic_bus1.svg", update the "filename" entry in Contents.json
to "ic_bus1.svg", and update any code or asset references that point to "ic_bus
1.svg" so the asset name and folder (ic_bus1.imageset) are consistent and
contain no spaces.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_chevron_up3.imageset/Contents.json`:
- Line 4: The asset filename contains an extra space ("ic_chevron_up 3.svg")
which mismatches its folder name (ic_chevron_up3.imageset); rename the SVG file
to remove the space (ic_chevron_up3.svg) and update Contents.json to reference
"ic_chevron_up3.svg" instead of "ic_chevron_up 3.svg" so the asset name and
.imageset folder are consistent and safe for scripts/CLI usage.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_close1.imageset/Contents.json`:
- Line 4: The asset Contents.json contains SVG filenames with spaces (e.g., the
string "ic_close 1.svg" in ic_close1.imageset) which will break tooling; rename
the actual SVG files to remove spaces (e.g., ic_close1.svg) and update every
corresponding "filename" entry in each Contents.json to the new names, repeating
this change for all icon assets that currently include spaces in their
filenames.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_phone1.imageset/Contents.json`:
- Line 4: The asset filename contains a space ("ic_phone 1.svg") which can break
build tools; rename the actual asset file to a space-free name (e.g.,
"ic_phone_1.svg" or "ic_phone1.svg"), update the "filename" entry in the
Contents.json (replace "ic_phone 1.svg" with the new name), and search the
project for any references to "ic_phone 1.svg" (storyboards, code, asset
catalogs) and update them to the new filename to keep references consistent.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_piggybank1.imageset/Contents.json`:
- Line 4: Update the "filename" entry in Contents.json to remove the space in
the SVG name: change the value "ic_piggybank 1.svg" to "ic_piggybank1.svg" (the
key is the "filename" field inside Contents.json for the
ic_piggybank1.imageset); also rename the actual asset file on disk to match the
new filename so the folder name and Contents.json remain consistent.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_refresh1.imageset/Contents.json`:
- Line 4: Contents.json contains a "filename" entry with a space in the asset
name ("ic_refresh 1.svg"); update that "filename" value to remove the space
("ic_refresh1.svg") and ensure any references elsewhere (asset catalog entries
or code that loads this asset) are updated to match the new filename to avoid
missing-asset issues.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_restaurant1.imageset/Contents.json`:
- Line 4: Contents.json currently references "ic_restaurant 1.svg" which
contains a space; update the "filename" value to "ic_restaurant1.svg" and also
rename the actual SVG asset file from "ic_restaurant 1.svg" to
"ic_restaurant1.svg" so naming matches other assets (e.g., ic_airplane1/ic_bag1)
and avoids build/VC issues; ensure the change is made in the
ic_restaurant1.imageset Contents.json "filename" field and the corresponding SVG
file in that asset folder.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_search1.imageset/Contents.json`:
- Line 4: The Contents.json entry contains a filename with a trailing space
("ic_search 1.svg") that mismatches the asset folder name (ic_search1); update
the filename value to "ic_search1.svg" in Contents.json and rename the actual
SVG file to remove the space so the asset folder and Contents.json are
consistent, and then scan other DSKit assets (e.g., "ic_airplane 1.svg", "ic_bag
1.svg", "ic_book 1.svg", "ic_bus 1.svg"/"ic_bus 2.svg") to apply the same rename
pattern for consistent naming across all image sets.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_settings1.imageset/Contents.json`:
- Line 4: Multiple imagesets in DSKit have filenames and folder names containing
spaces (e.g., ic_settings1.imageset contains "ic_settings 1.svg", also ic_car
2.imageset, ic_clock 2.imageset), causing systemic build/script issues; rename
each imageset folder to remove spaces (e.g., ic_car2.imageset,
ic_settings1.imageset) and update the corresponding "filename" entries in each
Contents.json to match the folder-safe name (e.g., "ic_car2.svg",
"ic_settings1.svg"), then search the project for references to the old names and
update imports/usages so all asset references remain consistent.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_tool1.imageset/Contents.json`:
- Line 4: Contents.json에 등록된 "filename" 값에 공백이 포함되어 있습니다: "ic_tool 1.svg". 변경할
때는 해당 키의 값을 "ic_tool1.svg"로 수정하고 에셋 카탈로그 내 실제 파일도 동일하게 이름을 변경하여 일관성을 유지하세요
(Contents.json의 "filename" 항목과 실제 SVG 파일명이 일치하도록 ic_tool 1.svg → ic_tool1.svg로
교체).

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_train1.imageset/Contents.json`:
- Line 4: Contents.json references "ic_train 1.svg" which contains a space and
mismatches the asset folder name ic_train1.imageset; rename the actual SVG file
to remove the space (ic_train1.svg) and update the "filename" value inside
Contents.json to "ic_train1.svg" so the manifest and asset file name are
consistent; also search for any other references to "ic_train 1.svg" in the
project/CI scripts and update them to the new name.

In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_walk2.imageset/Contents.json`:
- Line 4: Update the asset filename to remove the space: in the Contents.json
entry that currently reads "ic_walk 2.svg", change it to "ic_walk2.svg" and also
rename the actual SVG file from ic_walk 2.svg to ic_walk2.svg in the
ic_walk2.imageset folder; ensure the imageset directory name remains
ic_walk2.imageset and update any code or asset references that point to "ic_walk
2.svg" so they reference "ic_walk2.svg".

In `@Projects/Modules/DSKit/Sources/UIColor`+.swift:
- Around line 54-59: Rename the misspelled Icon token property from teriary to
tertiary in the public enum Icon (replace public static let teriary with public
static let tertiary = DSKitAsset.Colors.gray500.color) and to preserve binary
compatibility add a deprecated alias named teriary that forwards to tertiary
(mark it `@available`(*, deprecated, message: "Use `tertiary` instead") returning
the same DSKitAsset.Colors.gray500.color) so callers get a deprecation warning
but existing code still compiles.
♻️ Duplicate comments (10)
Projects/Modules/DSKit/Resources/Assets.xcassets/ic_search2.imageset/Contents.json (1)

1-12: 파일명 컨벤션 이슈

ic_car1.imageset 리뷰에서 언급한 것과 동일한 파일명 공백 및 네이밍 불일치 이슈가 있습니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_map1.imageset/Contents.json (1)

1-12: 파일명 컨벤션 이슈

ic_car1.imageset 리뷰에서 언급한 것과 동일한 파일명 공백 및 네이밍 불일치 이슈가 있습니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_chevron_up1.imageset/Contents.json (1)

1-12: 파일명 컨벤션 이슈

ic_car1.imageset 리뷰에서 언급한 것과 동일한 파일명 공백 및 네이밍 불일치 이슈가 있습니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_tv1.imageset/Contents.json (1)

1-12: 이전 파일과 동일한 네이밍 패턴

ic_chevron_left1.imageset과 동일하게 폴더명과 파일명 간 공백 불일치가 있습니다. 에셋 전체에 대해 일괄적으로 네이밍 컨벤션을 통일하는 것을 고려해 주세요.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_card1.imageset/Contents.json (1)

1-12: 이전 파일들과 동일한 네이밍 패턴

다른 이미지 에셋과 동일한 폴더/파일명 불일치 패턴입니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_book1.imageset/Contents.json (1)

1-12: 이전 파일들과 동일한 네이밍 패턴

다른 이미지 에셋과 동일한 폴더/파일명 불일치 패턴입니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_coffee1.imageset/Contents.json (1)

4-4: 파일명 공백 이슈 (중복)

이전 파일과 동일하게 "ic_coffee 1.svg" 파일명에 공백이 포함되어 있습니다. 다른 아이콘 에셋들도 동일한 패턴을 따르고 있으므로, 전체 에셋에 대해 일괄적으로 파일명에서 공백을 제거하는 것을 권장합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_magic1.imageset/Contents.json (1)

1-12: 파일명 공백 이슈 (중복)

앞서 언급된 것과 동일한 파일명 공백 이슈입니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_sliders1.imageset/Contents.json (1)

1-12: 파일명 공백 이슈 (중복)

앞서 언급된 것과 동일한 파일명 공백 이슈입니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_menu2.imageset/Contents.json (1)

1-12: 파일명 공백 이슈 (중복)

앞서 언급된 것과 동일한 파일명 공백 이슈입니다.

🧹 Nitpick comments (19)
Projects/Modules/DSKit/Resources/Assets.xcassets/ic_star2.imageset/Contents.json (1)

4-4: 파일명 불일치 및 공백 문제

이미지셋 폴더명은 ic_star2(공백 없음)인데, 실제 SVG 파일명은 ic_star 2.svg(공백 포함)로 일관성이 없습니다. 또한 파일명에 공백이 포함되어 있어 빌드 스크립트나 CI/CD 파이프라인에서 문제가 발생할 수 있습니다.

파일명을 ic_star2.svg로 변경하여 폴더명과 일치시키는 것을 권장합니다.

♻️ 제안하는 수정
-      "filename" : "ic_star 2.svg",
+      "filename" : "ic_star2.svg",

실제 SVG 파일명도 ic_star2.svg로 변경해야 합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_coffee2.imageset/Contents.json (1)

4-4: 파일명에 공백이 포함되어 있어 일관성이 떨어집니다.

imageset 폴더명은 ic_coffee2인데, 실제 파일명은 ic_coffee 2.svg로 공백이 포함되어 있습니다. 유지보수 시 혼란을 줄 수 있으므로 파일명에서 공백을 제거하여 ic_coffee2.svg로 통일하는 것을 권장합니다.

♻️ 권장 수정 사항
  1. SVG 파일명을 ic_coffee2.svg로 변경
  2. Contents.json 업데이트:
-      "filename" : "ic_coffee 2.svg",
+      "filename" : "ic_coffee2.svg",
Projects/Modules/DSKit/Resources/Assets.xcassets/ic_home2.imageset/Contents.json (1)

4-4: 자산 파일명 공백 제거 권장 (Line 4)
파일명에 공백이 있으면 일부 스크립트/빌드 도구에서 경로 처리 문제가 날 수 있어요. 공백 없는 이름(예: ic_home_2.svg)으로 변경하고 실제 파일명 및 참조를 함께 업데이트하는 쪽을 권장합니다.

♻️ 제안 변경
-      "filename" : "ic_home 2.svg",
+      "filename" : "ic_home_2.svg",
Projects/Modules/DSKit/Resources/Assets.xcassets/ic_bus2.imageset/Contents.json (1)

1-12: 파일명의 공백 문자를 제거하는 것을 권장합니다.

파일명 "ic_bus 2.svg"에 공백이 포함되어 있습니다. 이는 디렉토리명 ic_bus2.imageset과 일관성이 없으며, 일반적인 에셋 네이밍 컨벤션에도 맞지 않습니다. 공백은 빌드 스크립트나 자동화 도구에서 문제를 일으킬 수 있습니다.

♻️ 제안하는 수정

파일명을 "ic_bus2.svg" 또는 "ic_bus_2.svg"로 변경하고, 실제 SVG 파일명도 함께 수정해주세요.

 {
   "images" : [
     {
-      "filename" : "ic_bus 2.svg",
+      "filename" : "ic_bus2.svg",
       "idiom" : "universal"
     }
   ],
   "info" : {
     "author" : "xcode",
     "version" : 1
   }
 }
Projects/Modules/DSKit/Resources/Assets.xcassets/ic_chevron_right3.imageset/Contents.json (1)

1-12: 파일명 일관성 개선 권장

에셋 파일명 "ic_chevron_right 3.svg"에 공백이 포함되어 있는데, 이미지셋 폴더명 ic_chevron_right3.imageset에는 공백이 없어 일관성이 떨어집니다. 디자인 시스템에서는 네이밍 일관성이 중요하며, PR의 다른 아이콘들(ic_airplane1, ic_bag1 등)도 공백 없이 명명된 것으로 보입니다.

파일명을 ic_chevron_right3.svg로 변경하여 폴더명과 일치시키고 전체 아이콘 네이밍 규칙과 통일하는 것을 권장합니다.

📝 권장 수정사항
  1. SVG 파일명을 ic_chevron_right 3.svg에서 ic_chevron_right3.svg로 변경
  2. Contents.json 업데이트:
 {
   "images" : [
     {
-      "filename" : "ic_chevron_right 3.svg",
+      "filename" : "ic_chevron_right3.svg",
       "idiom" : "universal"
     }
   ],
   "info" : {
     "author" : "xcode",
     "version" : 1
   }
 }
Projects/Modules/DSKit/Resources/Assets.xcassets/ic_bus1.imageset/Contents.json (1)

1-12: SVG 에셋 속성 추가를 고려해보세요.

SVG 파일의 경우, 벡터 데이터 보존 및 템플릿 렌더링 설정을 추가하면 더 나은 결과를 얻을 수 있습니다:

  • preserve-vector-representation: 벡터 데이터를 보존하여 다양한 해상도에서 선명하게 표시
  • template-rendering-intent: 틴트 컬러 적용 가능
선택적 개선 사항
 {
   "images" : [
     {
       "filename" : "ic_bus1.svg",
       "idiom" : "universal"
     }
   ],
   "info" : {
     "author" : "xcode",
     "version" : 1
-  }
+  },
+  "properties" : {
+    "preserves-vector-representation" : true,
+    "template-rendering-intent" : "template"
+  }
 }

참고: 이 속성들은 아이콘을 틴트 컬러로 커스터마이징하거나 다양한 크기에서 벡터 품질을 유지해야 하는 경우에 유용합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_share1.imageset/Contents.json (1)

4-4: 파일명의 공백 제거를 권장합니다.

파일명 "ic_share 1.svg"에 공백이 포함되어 있는데, 이는 폴더명 ic_share1.imageset과 일관성이 없습니다. iOS 개발 관례상 에셋 파일명에는 공백 대신 언더스코어나 하이픈을 사용하는 것이 권장됩니다.

♻️ 제안하는 수정 사항

파일명을 ic_share1.svg 또는 ic_share_1.svg로 변경하고, Contents.json도 함께 업데이트하세요:

-      "filename" : "ic_share 1.svg",
+      "filename" : "ic_share1.svg",
Projects/Modules/DSKit/Resources/Assets.xcassets/ic_star_fill1.imageset/Contents.json (1)

1-12: 파일명 정리 검토 권장 (공백 제거)

"ic_star_fill 1.svg" 파일명의 공백은 현재 정상 작동하고 있으나, 빌드 스크립트나 코드 생성 도구(예: SwiftGen) 호환성 측면에서 ic_star_fill1.svg로 일관되게 정리하면 향후 잠재적 문제를 방지할 수 있습니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_car1.imageset/Contents.json (1)

1-12: 파일명에 공백 사용 및 네이밍 불일치 검토 필요

폴더명(ic_car1.imageset)과 실제 파일명(ic_car 1.svg)의 네이밍 규칙이 일치하지 않습니다. 또한 파일명에 공백이 포함되어 있어 빌드 스크립트나 CLI 도구 사용 시 문제가 발생할 수 있습니다.

다른 이미지 에셋들(ic_search2, ic_map1, ic_chevron_up1 등)에서도 동일한 패턴이 보입니다. 일관된 네이밍 컨벤션(예: ic_car_1.svg 또는 ic_car1.svg)을 적용하는 것을 권장합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_chevron_left1.imageset/Contents.json (1)

1-12: 파일명 내 공백 및 네이밍 불일치 확인 필요

폴더명은 ic_chevron_left1(공백 없음)이지만, 파일명은 "ic_chevron_left 1.svg"(숫자 앞 공백 있음)로 불일치합니다. 파일명의 공백은 일부 빌드 환경이나 스크립트에서 문제를 일으킬 수 있으므로, 일관된 네이밍 컨벤션 적용을 권장합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_car 3.imageset/Contents.json (1)

1-12: 폴더명에 공백 포함 - 다른 에셋과 불일치

이 에셋의 폴더명(ic_car 3.imageset)에는 공백이 포함되어 있어, 다른 에셋 폴더(ic_tv1.imageset, ic_card1.imageset 등)와 네이밍 컨벤션이 다릅니다. 빌드 스크립트나 경로 처리 시 문제가 발생할 수 있으므로, 전체 에셋의 네이밍 컨벤션을 통일하는 것을 권장합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_bag1.imageset/Contents.json (1)

4-4: 파일명 네이밍 일관성 검토 필요.

폴더명은 ic_bag1.imageset(공백 없음)인데 SVG 파일명은 "ic_bag 1.svg"(공백 있음)로 네이밍 컨벤션이 일치하지 않습니다. 기능상 문제는 없지만, 일관된 네이밍을 위해 파일명에서 공백을 제거하는 것을 권장합니다.

제안된 수정
-      "filename" : "ic_bag 1.svg",
+      "filename" : "ic_bag1.svg",

SVG 파일명도 함께 변경해야 합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_plus1.imageset/Contents.json (1)

4-4: 파일명 네이밍 일관성 검토 필요.

ic_bag1.imageset과 동일하게 폴더명(ic_plus1)과 파일명(ic_plus 1.svg) 간 공백 사용이 불일치합니다. 일관성을 위해 파일명에서 공백 제거를 권장합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_restaurant2.imageset/Contents.json (1)

4-4: 파일명 네이밍 일관성 검토 필요.

폴더명(ic_restaurant2)과 파일명(ic_restaurant 2.svg) 간 공백 사용이 불일치합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_flag2.imageset/Contents.json (1)

4-4: 파일명 네이밍 일관성 검토 필요.

폴더명(ic_flag2)과 파일명(ic_flag 2.svg) 간 공백 사용이 불일치합니다. PR 요약에 따르면 60개 이상의 아이콘이 추가되었으므로, 전체 아이콘 에셋에 대해 네이밍 컨벤션을 통일하는 것을 권장합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_pin1.imageset/Contents.json (1)

4-4: 파일명에 공백이 포함되어 있습니다.

"ic_pin 1.svg" 파일명에 공백이 포함되어 있어 디렉토리명(ic_pin1.imageset)과 일관성이 없습니다. 일부 CI/빌드 시스템에서 공백이 포함된 파일명은 문제를 일으킬 수 있으므로, "ic_pin1.svg"로 변경하는 것을 권장합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_chevron_left2.imageset/Contents.json (1)

4-4: 파일명에 공백이 포함되어 있고 폴더명과 일치하지 않습니다.

파일명 "ic_chevron_left 2.svg"에 공백이 포함되어 있으며, imageset 폴더명 ic_chevron_left2와 일치하지 않습니다. 일부 빌드 스크립트나 CI 환경에서 공백이 포함된 파일명으로 인해 문제가 발생할 수 있습니다. 일관성과 안정성을 위해 파일명에서 공백을 제거하는 것을 권장합니다.

💡 제안하는 수정
-      "filename" : "ic_chevron_left 2.svg",
+      "filename" : "ic_chevron_left2.svg",

실제 SVG 파일명도 함께 변경해야 합니다.

Projects/Modules/DSKit/Resources/Assets.xcassets/ic_edit2.imageset/Contents.json (1)

4-4: 파일명에 공백이 포함되어 있습니다.

이전 파일과 동일한 문제입니다. "ic_edit 2.svg" 파일명의 공백을 제거하여 폴더명 ic_edit2와 일관성을 맞추는 것을 권장합니다.

💡 제안하는 수정
-      "filename" : "ic_edit 2.svg",
+      "filename" : "ic_edit2.svg",
.swiftlint.yml (1)

38-38: function_body_length 규칙 비활성화에 대한 검토 필요.

function_body_length 규칙을 완전히 비활성화하면 지나치게 긴 함수가 허용될 수 있습니다. 대신 특정 파일만 제외하거나 임계값을 높이는 방식을 고려해 보세요.

💡 대안: 임계값 조정

완전히 비활성화하는 대신 임계값을 조정하는 방법:

function_body_length:
  warning: 100
  error: 200

{
"images" : [
{
"filename" : "ic_bus 1.svg",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일명에 공백이 포함되어 폴더명과 불일치합니다.

파일명 "ic_bus 1.svg"에 공백이 있지만, 폴더명은 ic_bus1.imageset로 언더스코어를 사용하고 있습니다. 이러한 불일치는 다음과 같은 문제를 야기할 수 있습니다:

  • 코드베이스의 일관성 저하
  • 일부 빌드 도구나 스크립트에서 공백이 있는 파일명 처리 시 문제 발생 가능
  • 개발자 혼란 초래

파일명을 "ic_bus1.svg"로 변경하여 폴더명과 일치시키는 것을 권장합니다.

제안하는 수정
-      "filename" : "ic_bus 1.svg",
+      "filename" : "ic_bus1.svg",
🤖 Prompt for AI Agents
In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_bus1.imageset/Contents.json`
at line 4, Contents.json lists the asset file as "ic_bus 1.svg" which contains a
space and does not match the asset folder name ic_bus1.imageset; rename the
actual asset file to "ic_bus1.svg", update the "filename" entry in Contents.json
to "ic_bus1.svg", and update any code or asset references that point to "ic_bus
1.svg" so the asset name and folder (ic_bus1.imageset) are consistent and
contain no spaces.

{
"images" : [
{
"filename" : "ic_close 1.svg",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일명에 공백이 포함되어 있습니다.

이 PR의 다른 아이콘 에셋들도 동일한 문제가 있습니다. 모든 SVG 파일명에서 공백을 일괄 제거하는 것을 권장합니다 (예: "ic_close 1.svg""ic_close1.svg").

🤖 Prompt for AI Agents
In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_close1.imageset/Contents.json`
at line 4, The asset Contents.json contains SVG filenames with spaces (e.g., the
string "ic_close 1.svg" in ic_close1.imageset) which will break tooling; rename
the actual SVG files to remove spaces (e.g., ic_close1.svg) and update every
corresponding "filename" entry in each Contents.json to the new names, repeating
this change for all icon assets that currently include spaces in their
filenames.

Comment thread Projects/Modules/DSKit/Resources/Assets.xcassets/ic_phone1.imageset/Contents.json Outdated
{
"images" : [
{
"filename" : "ic_settings 1.svg",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the file exists and examine its contents
if [ -f "Projects/Modules/DSKit/Resources/Assets.xcassets/ic_settings1.imageset/Contents.json" ]; then
  echo "=== File Contents ==="
  cat "Projects/Modules/DSKit/Resources/Assets.xcassets/ic_settings1.imageset/Contents.json"
else
  echo "File not found"
fi

Repository: YAPP-Github/27th-App-Team-1-iOS

Length of output: 259


🏁 Script executed:

#!/bin/bash
# Search for Contents.json files in the asset catalog
find Projects/Modules/DSKit/Resources/Assets.xcassets -name "Contents.json" -type f | head -20

Repository: YAPP-Github/27th-App-Team-1-iOS

Length of output: 1757


🏁 Script executed:

#!/bin/bash
# Search for filenames with spaces in Contents.json files
rg -n '"filename"\s*:\s*"[^"]*\s[^"]*"' --type json Projects/Modules/DSKit/Resources/Assets.xcassets/ 2>/dev/null || echo "Pattern not found or no matches"

Repository: YAPP-Github/27th-App-Team-1-iOS

Length of output: 7610


🏁 Script executed:

#!/bin/bash
# Alternative: List all imagesets and their filenames
find Projects/Modules/DSKit/Resources/Assets.xcassets -name "*.imageset" -type d | sort

Repository: YAPP-Github/27th-App-Team-1-iOS

Length of output: 4301


여러 asset에서 파일명 공백 문제가 광범위하게 발생합니다.

ic_settings1.imageset"ic_settings 1.svg" 파일명 공백은 개별 문제가 아니라, 자산 카탈로그 전체에 걸쳐 56개 이상의 이미지셋에서 발생하는 체계적인 문제입니다. 폴더 이름도 일부는 공백을 포함하고 있어(예: ic_car 2.imageset, ic_clock 2.imageset) 일관성이 부족합니다.

공백이 포함된 파일명은 빌드 시스템이나 스크립트에서 오류를 초래할 수 있으므로, 다음을 권장합니다:

  • 모든 imageset 폴더명을 공백 없이 통일 (예: ic_car2.imageset)
  • 모든 filename을 폴더명과 일치하도록 공백 제거 (예: "ic_car2.svg")
  • 이 변경사항은 DSKit 전체 asset을 대상으로 진행해야 합니다.
🤖 Prompt for AI Agents
In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_settings1.imageset/Contents.json`
at line 4, Multiple imagesets in DSKit have filenames and folder names
containing spaces (e.g., ic_settings1.imageset contains "ic_settings 1.svg",
also ic_car 2.imageset, ic_clock 2.imageset), causing systemic build/script
issues; rename each imageset folder to remove spaces (e.g., ic_car2.imageset,
ic_settings1.imageset) and update the corresponding "filename" entries in each
Contents.json to match the folder-safe name (e.g., "ic_car2.svg",
"ic_settings1.svg"), then search the project for references to the old names and
update imports/usages so all asset references remain consistent.

{
"images" : [
{
"filename" : "ic_tool 1.svg",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일명에 공백이 포함되어 있습니다.

"ic_tool 1.svg""ic_tool1.svg"로 변경하여 네이밍 일관성을 유지하세요.

🤖 Prompt for AI Agents
In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_tool1.imageset/Contents.json`
at line 4, Contents.json에 등록된 "filename" 값에 공백이 포함되어 있습니다: "ic_tool 1.svg". 변경할
때는 해당 키의 값을 "ic_tool1.svg"로 수정하고 에셋 카탈로그 내 실제 파일도 동일하게 이름을 변경하여 일관성을 유지하세요
(Contents.json의 "filename" 항목과 실제 SVG 파일명이 일치하도록 ic_tool 1.svg → ic_tool1.svg로
교체).

{
"images" : [
{
"filename" : "ic_train 1.svg",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일명에 공백이 포함되어 있습니다.

"ic_train 1.svg" 파일명에 공백이 포함되어 있어 폴더명 ic_train1.imageset과 일관성이 없습니다. 공백이 포함된 파일명은 일부 빌드 스크립트나 CI/CD 파이프라인에서 문제를 일으킬 수 있습니다.

권장 수정안
-      "filename" : "ic_train 1.svg",
+      "filename" : "ic_train1.svg",

실제 SVG 파일명도 함께 변경해야 합니다.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"filename" : "ic_train 1.svg",
"filename" : "ic_train1.svg",
🤖 Prompt for AI Agents
In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_train1.imageset/Contents.json`
at line 4, Contents.json references "ic_train 1.svg" which contains a space and
mismatches the asset folder name ic_train1.imageset; rename the actual SVG file
to remove the space (ic_train1.svg) and update the "filename" value inside
Contents.json to "ic_train1.svg" so the manifest and asset file name are
consistent; also search for any other references to "ic_train 1.svg" in the
project/CI scripts and update them to the new name.

{
"images" : [
{
"filename" : "ic_walk 2.svg",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일명의 공백 문자를 언더스코어로 변경하세요.

파일명 "ic_walk 2.svg"에 공백이 포함되어 있습니다. 다른 아이콘 에셋들(ic_airplane1, ic_bag1, ic_book1)과의 일관성을 위해, 그리고 이미지셋 디렉토리명(ic_walk2.imageset)과의 일치를 위해 "ic_walk2.svg"로 변경하는 것이 좋습니다. 공백이 포함된 파일명은 빌드 스크립트나 명령줄 도구 사용 시 문제를 일으킬 수 있습니다.

🔧 제안하는 수정
-      "filename" : "ic_walk 2.svg",
+      "filename" : "ic_walk2.svg",

참고: 실제 SVG 파일명도 ic_walk2.svg로 함께 변경해야 합니다.

🤖 Prompt for AI Agents
In
`@Projects/Modules/DSKit/Resources/Assets.xcassets/ic_walk2.imageset/Contents.json`
at line 4, Update the asset filename to remove the space: in the Contents.json
entry that currently reads "ic_walk 2.svg", change it to "ic_walk2.svg" and also
rename the actual SVG file from ic_walk 2.svg to ic_walk2.svg in the
ic_walk2.imageset folder; ensure the imageset directory name remains
ic_walk2.imageset and update any code or asset references that point to "ic_walk
2.svg" so they reference "ic_walk2.svg".

Comment on lines +54 to +59
public enum Icon {
public static let primary = DSKitAsset.Colors.gray900.color
public static let secondary = DSKitAsset.Colors.gray700.color
public static let teriary = DSKitAsset.Colors.gray500.color
public static let danger = DSKitAsset.Colors.red700.color
public static let disabled = DSKitAsset.Colors.gray400.color
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Icon 토큰의 teriary 오타 수정 필요.
공개 API라 지금 바로 tertiary로 바로잡는 편이 안전합니다(필요하면 기존 이름은 deprecated로 유지).

🔧 수정 제안
 public enum Icon {
     public static let primary = DSKitAsset.Colors.gray900.color
     public static let secondary = DSKitAsset.Colors.gray700.color
-    public static let teriary = DSKitAsset.Colors.gray500.color
+    public static let tertiary = DSKitAsset.Colors.gray500.color
+    `@available`(*, deprecated, renamed: "tertiary")
+    public static let teriary = tertiary
     public static let danger = DSKitAsset.Colors.red700.color
     public static let disabled = DSKitAsset.Colors.gray400.color
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public enum Icon {
public static let primary = DSKitAsset.Colors.gray900.color
public static let secondary = DSKitAsset.Colors.gray700.color
public static let teriary = DSKitAsset.Colors.gray500.color
public static let danger = DSKitAsset.Colors.red700.color
public static let disabled = DSKitAsset.Colors.gray400.color
public enum Icon {
public static let primary = DSKitAsset.Colors.gray900.color
public static let secondary = DSKitAsset.Colors.gray700.color
public static let tertiary = DSKitAsset.Colors.gray500.color
`@available`(*, deprecated, renamed: "tertiary")
public static let teriary = tertiary
public static let danger = DSKitAsset.Colors.red700.color
public static let disabled = DSKitAsset.Colors.gray400.color
🤖 Prompt for AI Agents
In `@Projects/Modules/DSKit/Sources/UIColor`+.swift around lines 54 - 59, Rename
the misspelled Icon token property from teriary to tertiary in the public enum
Icon (replace public static let teriary with public static let tertiary =
DSKitAsset.Colors.gray500.color) and to preserve binary compatibility add a
deprecated alias named teriary that forwards to tertiary (mark it `@available`(*,
deprecated, message: "Use `tertiary` instead") returning the same
DSKitAsset.Colors.gray500.color) so callers get a deprecation warning but
existing code still compiles.

Comment on lines +1 to +11
{
"images" : [
{
"filename" : "ic_video1.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

개인적인 궁금증인데요, 이미지를 svg로 처리하신 이유가 있나요 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

svg의 경우 아이콘 크기에 상관없이 선명한 화질을 유지할 수 있고, 해상도별로 파일을 만들 필요가 없어 리소스 관리 효율이 높습니다.
또한 복잡하지 않은 아이콘의 경우 PNG 대비 용량이 작아 앱 최적화 측면에서도 유리하다고 판단했습니다!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

오.. 그렇다면 단순 아이콘, 로고가 아니라 고해상도 이미지가 필요하다면 다른 걸 사용하실 것 같나용?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

넵 이미지가 복잡한 경우는 해상도별 png를 사용할 거 같습니다

}
}

public enum Bg {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bg가 Background의 약자인가요? 확 와닿진 않아서 네이밍 그대로 Background로 해보면 어떨까요 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bg의 경우 디자인 시스템에 Bg로 표현되어 있어서 피그마를 볼 때 찾기 쉽게 해당 네이밍을 사용했습니다

Comment on lines +12 to +35
// Titles
case titleLB // 행간 140%, 자간 -2.5%
case titleLSB // 행간 140%, 자간 -2.5%
case titleMB // 행간 140%, 자간 -2%
case titleMSB // 행간 140%, 자간 -2%

// SubTitles
case subTitleLSB // 행간 140%, 자간 -2.5%
case subTitleLM // 행간 140%, 자간 -2.5%
case subTitleMB // 행간 130%, 자간 -2.5%
case subTitleMSB // 행간 130%, 자간 -2.5%
case subTitleMM // 행간 130%, 자간 -2.5%

// Body
case bodyLSB // 행간 130%, 자간 -2.5%
case bodyLM // 행간 130%, 자간 -2.5%
case bodyLR // 행간 130%, 자간 -2.5%
case bodyMSB // 행간 130%, 자간 -2.5%
case bodyMM // 행간 130%, 자간 -2.5%
case bodyMR // 행간 130%, 자간 -2.5%
case bodySSB // 행간 120%, 자간 -1%
case bodySM // 행간 130%, 자간 -2.5%
case bodySR // 행간 130%, 자간 -2.5%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

네이밍을 보고 이것을 유추해야 하기 때문에 /// 주석으로 문서 주석(Documentation Comment) 남겨보면 어떨까요 ? 자동완성할 때 옆에 설명이 표시되어서 더 좋을 것 같습니다.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

그리고 개인적으로 폰트를 사용하는 쪽에서

        subTitleLM.do {
            $0.attributedText = NSAttributedString(
                string: "Subtitle 20 Medium",
                attributes: UIFont.NDGL.subTitleLM.attributes
            )
            $0.backgroundColor = .NDGL.Bg.Interactive.subtlePressed
        }

말씀해주신 방식으로 코드를 썼을때 좀 길어져서 가독성이 더 좋아졌으면 좋겠다는 생각이 들었습니다. backgrdoundcolor, string, attributes를 지정하는걸 각각 따로 지정하거나 하는 방향은 어떻게 생각하시나요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

문서 주석 처리해두겠습니다!
다음 질문은 이해를 못했는데 혹시 예시를 알 수 있을까요??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

titleLabel.setText("타이틀", style: .titleLB, color: .NDGL.Text.primary) 간단한 예시로 이런식으로 사용할 수 있도록 생각했습니다. ( color, style, text 를 각각 분리도 가능. ) 텍스트를 지정할때마다 NSAttributedString를 직접 쓴다는 것을 줄이는 걸 고려했습니다. extension 함수 하나 추가하는 방향이요!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

저는 Label 뿐만 아니라 다른 곳에서도 쓸 수 있게 하려다 보니까 이런 방식으로 구현했습니다.
UILabel만 Extension으로 setText와 같은 함수를 구현해둘까요??
다른 컴포넌트까지 Extension으로 구현할까요?

@KimNahun
Copy link
Copy Markdown
Contributor

수고하셨습니다~ 저도 자기전에는 PR 올려볼꼐욥...

Copy link
Copy Markdown
Contributor

@KimNahun KimNahun left a comment

Choose a reason for hiding this comment

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

그리고 1가지 더 있다면 보통 디자인 시스템에 있는 색상을 가져다가 쓰겠지만, 뭔가 가끔 1,2개씩 다른 색상 쓸 수도 있어서 그럴때를 대응하기 위한 fromHex(String) 함수 1개로 hex 코드 읽어와서 색상 지정하는 코드도 있다면 어떨까요?

@ChoiAnYong
Copy link
Copy Markdown
Contributor Author

HexCode 변환 convenience init 구현해두었습니다!

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@Projects/Core/Sources/Extensions/UIKit`+/UILabel+.swift:
- Line 2: Top-of-file header comment contains a typo: it reads
"UILabel+.swift.swift" instead of "UILabel+.swift"; update the file header
comment in UILabel+.swift (the top comment block) to remove the duplicated
".swift" so it correctly shows "UILabel+.swift".
- Around line 26-28: The code uses text.count when constructing NSRange which is
wrong for NSAttributedString APIs that expect UTF-16 code unit lengths; replace
the length calculation in the NSRange passed to
mutableAtbString.addAttributes(...) with a UTF-16 based length (e.g. use
text.utf16.count or (text as NSString).length) so the range matches the
attributedText attributes call and avoids crashes for emojis/combined
characters; update the NSRange(location: 0, length: ...) usage in this block
around mutableAtbString and attributedText.attributes to use the UTF-16 length.

In `@Projects/Modules/DSKit/Sources/Extensions/UIKit`+/UIColor+.swift:
- Line 17: The declaration public static  let danger in UIColor+.swift contains
an extra space between static and let; update the declaration for the symbol
danger to have a single space (public static let danger =
DSKitAsset.Colors.red600.color) so the spacing is consistent and linting passes.
🧹 Nitpick comments (1)
Projects/Core/Sources/Extensions/UIKit+/UIColor+.swift (1)

22-25: assert는 릴리스 빌드에서 제거되므로 프로덕션에서 잘못된 hex 값이 조용히 통과됩니다.

assert는 디버그 빌드에서만 동작합니다. 릴리스 빌드에서는 잘못된 hex 코드가 검증 없이 통과되어 검은색(0x000000)이 반환될 수 있습니다.

♻️ 권장 수정안
-        assert(hexFormatted.count == 6, "Invalid hex code used.")
-        
-        var rgbValue: UInt64 = 0
-        Scanner(string: hexFormatted).scanHexInt64(&rgbValue)
+        guard hexFormatted.count == 6 else {
+            assertionFailure("Invalid hex code used: \(hexCode)")
+            self.init(white: 0, alpha: alpha)
+            return
+        }
+        
+        var rgbValue: UInt64 = 0
+        guard Scanner(string: hexFormatted).scanHexInt64(&rgbValue) else {
+            assertionFailure("Failed to parse hex code: \(hexCode)")
+            self.init(white: 0, alpha: alpha)
+            return
+        }

@@ -0,0 +1,48 @@
//
// UILabel+.swift.swift
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일명 주석에 오타가 있습니다.

UILabel+.swift.swift로 되어 있습니다. UILabel+.swift로 수정해주세요.

🤖 Prompt for AI Agents
In `@Projects/Core/Sources/Extensions/UIKit`+/UILabel+.swift at line 2,
Top-of-file header comment contains a typo: it reads "UILabel+.swift.swift"
instead of "UILabel+.swift"; update the file header comment in UILabel+.swift
(the top comment block) to remove the duplicated ".swift" so it correctly shows
"UILabel+.swift".

Comment on lines +26 to +28
let mutableAtbString = NSMutableAttributedString(string: text)
let attributes = attributedText.attributes(at: 0, effectiveRange: nil)
mutableAtbString.addAttributes(attributes, range: NSRange(location: 0, length: text.count))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

text.count 대신 UTF-16 길이를 사용해야 합니다.

NSRange는 UTF-16 코드 유닛 기반으로 동작하지만, Swift의 String.count는 grapheme cluster 수를 반환합니다. 이모지나 조합 문자가 포함된 텍스트에서 범위 불일치로 크래시가 발생할 수 있습니다.

🐛 수정 제안
         let mutableAtbString = NSMutableAttributedString(string: text)
         let attributes = attributedText.attributes(at: 0, effectiveRange: nil)
-        mutableAtbString.addAttributes(attributes, range: NSRange(location: 0, length: text.count))
+        mutableAtbString.addAttributes(attributes, range: NSRange(location: 0, length: mutableAtbString.length))
🤖 Prompt for AI Agents
In `@Projects/Core/Sources/Extensions/UIKit`+/UILabel+.swift around lines 26 - 28,
The code uses text.count when constructing NSRange which is wrong for
NSAttributedString APIs that expect UTF-16 code unit lengths; replace the length
calculation in the NSRange passed to mutableAtbString.addAttributes(...) with a
UTF-16 based length (e.g. use text.utf16.count or (text as NSString).length) so
the range matches the attributedText attributes call and avoids crashes for
emojis/combined characters; update the NSRange(location: 0, length: ...) usage
in this block around mutableAtbString and attributedText.attributes to use the
UTF-16 length.

public static let primary = DSKitAsset.Colors.gray900.color
public static let secondary = DSKitAsset.Colors.gray700.color
public static let tertiary = DSKitAsset.Colors.gray500.color
public static let danger = DSKitAsset.Colors.red600.color
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

불필요한 공백이 있습니다.

public static let danger에서 staticlet 사이에 공백이 두 개 있습니다.

✏️ 수정 제안
-            public static  let danger = DSKitAsset.Colors.red600.color
+            public static let danger = DSKitAsset.Colors.red600.color
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static let danger = DSKitAsset.Colors.red600.color
public static let danger = DSKitAsset.Colors.red600.color
🤖 Prompt for AI Agents
In `@Projects/Modules/DSKit/Sources/Extensions/UIKit`+/UIColor+.swift at line 17,
The declaration public static  let danger in UIColor+.swift contains an extra
space between static and let; update the declaration for the symbol danger to
have a single space (public static let danger = DSKitAsset.Colors.red600.color)
so the spacing is consistent and linting passes.

@ChoiAnYong ChoiAnYong merged commit 3327bcc into develop Jan 21, 2026
2 checks passed
@ChoiAnYong ChoiAnYong deleted the design/#4-DSKit_Setting branch January 21, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

디자인 시스템 모듈 세팅

2 participants