Skip to content

Comments

Feat/#52 기기대응 익스텐션#53

Merged
y-eonee merged 3 commits intodevelopfrom
feat/#52-기기대응
Jan 13, 2026

Hidden character warning

The head ref may contain hidden characters: "feat/#52-\uae30\uae30\ub300\uc751"
Merged

Feat/#52 기기대응 익스텐션#53
y-eonee merged 3 commits intodevelopfrom
feat/#52-기기대응

Conversation

@y-eonee
Copy link
Contributor

@y-eonee y-eonee commented Jan 13, 2026

🔗 연결된 이슈

📄 작업 내용

  • 기기대응 익스텐션 추가했습니다
구현 내용 IPhone 16 pro IPhone 13 mini
GIF

💻 주요 코드 설명

 var adjustedW: CGFloat {
        let ratio: CGFloat = UIScreen.main.bounds.width / 375
        return self * ratio
    }
    
  var adjustedH: CGFloat {
      let ratio: CGFloat = UIScreen.main.bounds.height / 812
      return self * ratio
  }

화면 크기 비율을 계산해서 다시 적용하는 익스텐션입니다.
호리존탈에는 adjustedW를, 버티컬에는 adjustedH를 적용해주시면 됩니다

@y-eonee y-eonee linked an issue Jan 13, 2026 that may be closed by this pull request
1 task
@y-eonee y-eonee requested review from a team, soseoyo12, sum130 and wotjs020708 and removed request for a team January 13, 2026 11:32
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

요약

이 PR은 화면 크기에 대응하는 Adjust+ 익스텐션을 새로 추가하고, 여러 UI 컴포넌트의 고정 크기 값들을 반응형 크기 조정 프로퍼티(adjustedW/adjustedH)로 변경하며, Info.plist의 UIDesignRequiresCompatibility 설정을 false에서 true로 업데이트합니다.

변경사항

응집 / 파일 변경 요약
Adjust+ 익스텐션
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Adjust+.swift
화면 너비(375 기준)와 높이(812 기준)를 기반으로 하는 adjustedW, adjustedH 계산 프로퍼티를 CGFloat, Double, Int 타입에 추가
UI 컴포넌트 - 크기 조정
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Component/Tabbar/CherrishTabBar.swift, Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift, Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishNavigationBar.swift, Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MissionCard.swift, Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/SelectionChip.swift
고정 레이아웃 상수(너비, 높이, 패딩)를 adjustedW/adjustedH를 사용한 반응형 값으로 변경; CherrishButton에서 내부 프리뷰 래퍼 및 SwiftUI 미리보기 제거
설정
Cherrish-iOS/Cherrish-iOS/Info.plist
UIDesignRequiresCompatibility 값을 false에서 true로 변경

예상 코드 리뷰 난이도

🎯 2 (Simple) | ⏱️ ~15 분

관련 PR

  • Refactor/#42 버튼 컴포넌트들 수정 #44: 동일한 UI 컴포넌트(CherrishButton, MissionCard, SelectionChip)를 수정하여 레이아웃 크기 조정 동작을 변경(이 PR은 반응형 adjustedW/adjustedH 크기 조정 추가; 해당 PR은 고정 너비를 제거하고 유동형/패딩 기반 크기 조정으로 변경)
  • Feat/#19 CherrishButtoncomponent 수정 #33: CherrishButton.swift를 수정(해당 PR은 CherrishButton 컴포넌트 및 타입 추가; 이 PR은 높이 값을 adjustedH를 사용하도록 업데이트하고 미리보기 제거)

제안 라벨

Feature

제안 검토자

  • wotjs020708
  • soseoyo12
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목 'Feat/#52 기기대응 익스텐션'은 주요 변경 사항인 기기 대응 익스텐션 추가를 명확하게 요약합니다.
Description check ✅ Passed PR 설명은 기기 대응 익스텐션 추가 작업, 구현 방식, 사용 지침, 비교 이미지를 포함하여 변경 사항과 관련이 있습니다.
Linked Issues check ✅ Passed PR은 #52 이슈에서 요구하는 기기 대응 익스텐션(adjustedW, adjustedH)을 구현하고, 프로젝트 전체에 적용했습니다.
Out of Scope Changes check ✅ Passed PR은 기기 대응 익스텐션 추가와 이를 레이아웃 컴포넌트에 적용하는 것이 주요 범위이며, UIDesignRequiresCompatibility 변경은 기기 대응 관련 설정 변경입니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#52-기기대응

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.

@y-eonee y-eonee self-assigned this Jan 13, 2026
Copy link
Contributor

@soseoyo12 soseoyo12 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~~~~

Copy link

@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: 2

🤖 Fix all issues with AI agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Adjust+.swift:
- Around line 23-33: The Double extension's adjustedW and adjustedH use
unnecessary full-expression Double(...) casting and duplicate logic; refactor by
extracting the scaling logic into a CGFloat extension (e.g., add computed
properties adjustedW and adjustedH on CGFloat that compute ratio using
UIScreen.main.bounds and constants 375/812), then have the Double extension call
that CGFloat conversion once (e.g., return CGFloat(self).adjustedW as Double) or
compute the ratio as a CGFloat and cast only the final result to Double,
removing the redundant Double(...) wrapping around the whole division.
- Around line 11-21: The extension on CGFloat uses deprecated
UIScreen.main.bounds and hard-coded magic numbers; update adjustedW and
adjustedH to obtain screen size via the active UIWindowScene (e.g., cast
UIApplication.shared.connectedScenes.first(where: { $0.activationState ==
.foregroundActive }) as? UIWindowScene and use its screen.bounds) and replace
the literals 375 and 812 with named constants (e.g., baseScreenWidth,
baseScreenHeight) defined near the extension; ensure you fall back to
UIScreen.main.bounds only if no active scene is found so the methods remain safe
in older iOS versions.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee800b4 and 32f64db.

📒 Files selected for processing (7)
  • Cherrish-iOS/Cherrish-iOS/Info.plist
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Component/Tabbar/CherrishTabBar.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishNavigationBar.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MissionCard.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/SelectionChip.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Adjust+.swift
🔇 Additional comments (8)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishNavigationBar.swift (1)

59-60: LGTM!

수직 레이아웃(높이, 수직 패딩)에 adjustedH를 올바르게 적용했습니다. 44pt는 표준 iOS 네비게이션 바 높이로 적절한 기준값입니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/SelectionChip.swift (1)

19-20: LGTM!

높이에 adjustedH를 올바르게 적용했습니다. cornerRadius는 고정값으로 유지한 것도 적절합니다 - 코너 반경은 일반적으로 화면 크기와 비례하지 않는 것이 시각적으로 더 자연스럽습니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift (1)

63-69: LGTM!

버튼 높이에 adjustedH를 올바르게 적용했습니다. cornerRadius는 고정값으로 유지하여 다른 컴포넌트들(SelectionChip 등)과 일관성을 유지합니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Component/Tabbar/CherrishTabBar.swift (2)

61-63: 아이콘 프레임의 가로/세로 비율 불일치 가능성.

widthheight 모두 adjustedW를 사용하고 있습니다. 화면 비율이 기준값(375x812)과 다른 기기에서는 아이콘이 정사각형을 유지하지만, 의도가 "정사각형 유지"인지 "수직 방향도 화면에 맞게 조정"인지에 따라 접근이 달라질 수 있습니다.

  • 정사각형 유지 의도: 현재 구현 유지 (둘 다 adjustedW 또는 둘 다 adjustedH)
  • 각 방향 독립 조정 의도: heightadjustedH 적용

현재 구현이 의도된 것이라면 문제없습니다.


72-74: LGTM!

수평 패딩에 adjustedW, 수직 패딩과 높이에 adjustedH를 올바르게 적용했습니다. PR의 사용 지침을 정확히 따르고 있습니다.

Cherrish-iOS/Cherrish-iOS/Info.plist (1)

12-13: iOS 26 Liquid Glass 비활성화를 위한 호환성 모드 설정이 적용되었습니다.

UIDesignRequiresCompatibilitytrue로 설정하여 앱이 iOS 26 Liquid Glass 디자인에서 벗어나고 하위 호환성을 유지합니다. 이 설정은 앱 전체에 적용되는 동작이며, 커밋 메시지에서 의도한 변경입니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Adjust+.swift (1)

35-43: LGTM!

Int 확장이 CGFloat 확장에 위임하여 코드 중복을 방지하고 있습니다. 좋은 패턴입니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/MissionCard.swift (1)

28-34: LGTM!

기기 대응 익스텐션이 PR 가이드라인에 맞게 적용되었습니다:

  • 수평 레이아웃(leading, horizontal padding) → adjustedW
  • 수직 레이아웃(bottom, vertical padding, height) → adjustedH

Comment on lines +11 to +21
extension CGFloat {
var adjustedW: CGFloat {
let ratio: CGFloat = UIScreen.main.bounds.width / 375
return self * ratio
}

var adjustedH: CGFloat {
let ratio: CGFloat = UIScreen.main.bounds.height / 812
return self * ratio
}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🌐 Web query:

UIScreen.main deprecated iOS 16 UIWindowScene alternative

💡 Result:

Short answer: don't use UIScreen.main — get the UIScreen from the relevant UIWindowScene (or from a view/window's windowScene). For scale you can also use UITraitCollection.current.displayScale.

Examples:

  • From a view or view controller:
    let screen = view.window?.windowScene?.screen
  • From app scenes:
    let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
    let screen = windowScene?.screen
  • For display scale (no UIApplication):
    let scale = UITraitCollection.current.displayScale

References: Apple recommendation to use the screen on the window scene, discussion/solutions (StackOverflow) and alternatives (UITraitCollection). [1][2][3]

Sources:
[1] Apple Developer (UIScreen docs / deprecation note).
[2] StackOverflow — "How do I get UIScreen.main.scale after iOS 16".
[3] Articles showing UIWindowScene / UITraitCollection alternatives.


🏁 Script executed:

# Find the actual file to verify its current state
find . -name "Adjust+.swift" -o -name "*Adjust*" | head -20

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 141


🏁 Script executed:

cat -n ./Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Adjust+.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1218


🏁 Script executed:

# Check if there are any usages of these adjusted properties in the codebase
rg "\.adjustedW|\.adjustedH" --type swift -A 2 -B 2 | head -30

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 2792


UIScreen.main이 iOS 16+에서 deprecated되었습니다.

UIScreen.main.bounds는 iOS 16 이상에서 deprecated되었으며, 현대적인 앱에서는 UIWindowScene을 통해 화면 정보를 가져와야 합니다. 또한 매직 넘버 375, 812를 상수로 추출하면 유지보수성이 향상됩니다.

♻️ 개선 제안
+private enum DesignSystem {
+    static let baseWidth: CGFloat = 375
+    static let baseHeight: CGFloat = 812
+}
+
 extension CGFloat {
     var adjustedW: CGFloat {
-        let ratio: CGFloat = UIScreen.main.bounds.width / 375
+        let screenWidth = UIApplication.shared.connectedScenes
+            .compactMap { $0 as? UIWindowScene }
+            .first?.screen.bounds.width ?? DesignSystem.baseWidth
+        let ratio = screenWidth / DesignSystem.baseWidth
         return self * ratio
     }
     
     var adjustedH: CGFloat {
-        let ratio: CGFloat = UIScreen.main.bounds.height / 812
+        let screenHeight = UIApplication.shared.connectedScenes
+            .compactMap { $0 as? UIWindowScene }
+            .first?.screen.bounds.height ?? DesignSystem.baseHeight
+        let ratio = screenHeight / DesignSystem.baseHeight
         return self * ratio
     }
 }
🤖 Prompt for AI Agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Adjust+.swift around
lines 11 - 21, The extension on CGFloat uses deprecated UIScreen.main.bounds and
hard-coded magic numbers; update adjustedW and adjustedH to obtain screen size
via the active UIWindowScene (e.g., cast
UIApplication.shared.connectedScenes.first(where: { $0.activationState ==
.foregroundActive }) as? UIWindowScene and use its screen.bounds) and replace
the literals 375 and 812 with named constants (e.g., baseScreenWidth,
baseScreenHeight) defined near the extension; ensure you fall back to
UIScreen.main.bounds only if no active scene is found so the methods remain safe
in older iOS versions.

Comment on lines +23 to +33
extension Double {
var adjustedW: Double {
let ratio: Double = Double(UIScreen.main.bounds.width / 375)
return self * ratio
}

var adjustedH: Double {
let ratio: Double = Double(UIScreen.main.bounds.height / 812)
return self * ratio
}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Double 확장에서 불필요한 캐스팅이 있습니다.

UIScreen.main.bounds.width / 375의 결과는 이미 CGFloat이므로 Double(...) 캐스팅 한 번이면 충분합니다. 현재 코드는 나눗셈 전체를 감싸고 있어 의도대로 동작하지만, CGFloat 확장을 재사용하면 중복을 줄일 수 있습니다.

♻️ 중복 제거 제안
 extension Double {
     var adjustedW: Double {
-        let ratio: Double = Double(UIScreen.main.bounds.width / 375)
-        return self * ratio
+        return Double(CGFloat(self).adjustedW)
     }
     
     var adjustedH: Double {
-        let ratio: Double = Double(UIScreen.main.bounds.height / 812)
-        return self * ratio
+        return Double(CGFloat(self).adjustedH)
     }
 }
🤖 Prompt for AI Agents
In @Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Adjust+.swift around
lines 23 - 33, The Double extension's adjustedW and adjustedH use unnecessary
full-expression Double(...) casting and duplicate logic; refactor by extracting
the scaling logic into a CGFloat extension (e.g., add computed properties
adjustedW and adjustedH on CGFloat that compute ratio using UIScreen.main.bounds
and constants 375/812), then have the Double extension call that CGFloat
conversion once (e.g., return CGFloat(self).adjustedW as Double) or compute the
ratio as a CGFloat and cast only the final result to Double, removing the
redundant Double(...) wrapping around the whole division.

Copy link
Contributor

@sum130 sum130 left a comment

Choose a reason for hiding this comment

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

와웅 뷰 짤 때 잘 쓰겠습니다 감사해요!!

Copy link
Contributor

@wotjs020708 wotjs020708 left a comment

Choose a reason for hiding this comment

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

어푸푸푸 고생하셨습니담

@y-eonee y-eonee merged commit 7516ca1 into develop Jan 13, 2026
1 check passed
@y-eonee y-eonee deleted the feat/#52-기기대응 branch January 13, 2026 11:38
@y-eonee y-eonee added 나연🐹 Feature 새로운 기능 구현 및 API 연결 labels Jan 13, 2026
Kimgyuilli pushed a commit that referenced this pull request Jan 21, 2026
This was referenced Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature 새로운 기능 구현 및 API 연결 나연🐹

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 기기대응 Extension

4 participants