Skip to content

Conversation

@wotjs020708
Copy link
Contributor

πŸ”— μ—°κ²°λœ 이슈

πŸ“„ μž‘μ—… λ‚΄μš©

  • ν‚€λ³΄λ“œ κΈ°κΈ° λŒ€μ‘ μ™„λ£Œ

@wotjs020708 wotjs020708 requested a review from a team January 22, 2026 15:45
@wotjs020708 wotjs020708 self-assigned this Jan 22, 2026
@wotjs020708 wotjs020708 requested review from soseoyo12, sum130 and y-eonee and removed request for a team January 22, 2026 15:45
@wotjs020708 wotjs020708 added μž¬μ„ πŸ» Fix 버그 μˆ˜μ • labels Jan 22, 2026
@wotjs020708 wotjs020708 linked an issue Jan 22, 2026 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

πŸ“ Walkthrough

λ‘˜λŸ¬λ³΄κΈ°

TargetDdaySettingViewμ—μ„œ ν‚€λ³΄λ“œ λ‚˜νƒ€λ‚¨/μˆ¨κΉ€ μ‹œ λ·°λ₯Ό μžλ™μœΌλ‘œ μŠ€ν¬λ‘€ν•˜λŠ” κΈ°λŠ₯을 μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€. ScrollViewReader, ν‚€λ³΄λ“œ 높이 좔적 μƒνƒœ, ν‚€λ³΄λ“œ μ•Œλ¦Ό ν•Έλ“€λŸ¬, 그리고 μž…λ ₯ ν•„λ“œλ‘œμ˜ μžλ™ 슀크둀 λ‘œμ§μ„ κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€.

변경사항

응집도 / 파일 λ³€κ²½ μš”μ•½
ν‚€λ³΄λ“œ λ°˜μ‘ν˜• 슀크둀 κ΅¬ν˜„
Cherrish-iOS/.../TargetDdaySettingView.swift
ScrollViewReader둜 감싸기, keyboardHeight μƒνƒœ μΆ”κ°€, ν‚€λ³΄λ“œ willShow/willHide μ•Œλ¦Ό ν•Έλ“€λŸ¬ κ΅¬ν˜„, onChange둜 ν‚€λ³΄λ“œ 높이 λ³€κ²½ μ‹œ μžλ™ 슀크둀, DateTextBox에 .id("inputField") μΆ”κ°€, λ ˆμ΄μ•„μ›ƒ λ¦¬νŒ©ν† λ§ 및 Yes/No μƒνƒœ μ„Ήμ…˜ 바인딩 μ‘°μ •

μ˜ˆμƒ μ½”λ“œ 리뷰 λ‚œμ΄λ„

🎯 3 (보톡) | ⏱️ ~20λΆ„

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive PR 제λͺ©μ΄ ν‚€λ³΄λ“œ κΈ°κΈ° λŒ€μ‘ μž‘μ—…κ³Ό 관련이 μžˆμ§€λ§Œ ꡬ체성이 λΆ€μ‘±ν•˜κ³  'Fix/#157'μ΄λΌλŠ” 이슈 λ²ˆν˜Έκ°€ ν˜Όλ™μ„ μ•ΌκΈ°ν•©λ‹ˆλ‹€. 제λͺ©μ„ 'ν‚€λ³΄λ“œ κΈ°κΈ° λŒ€μ‘' λ˜λŠ” 'TargetDdaySettingView에 ν‚€λ³΄λ“œ 인식 슀크둀 κΈ°λŠ₯ μΆ”κ°€'둜 λ³€κ²½ν•˜μ—¬ 더 λͺ…ν™•ν•˜κ²Œ 변경사항을 μ„€λͺ…ν•˜μ„Έμš”.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description check βœ… Passed PR μ„€λͺ…이 ν‚€λ³΄λ“œ κΈ°κΈ° λŒ€μ‘ μž‘μ—…κ³Ό 관련이 있으며 μ—°κ²°λœ 이슈 #169λ₯Ό λͺ…μ‹œν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.
Linked Issues check βœ… Passed ScrollViewReader μΆ”κ°€, ν‚€λ³΄λ“œ 높이 좔적, μžλ™ 슀크둀 κΈ°λŠ₯ 등이 κ΅¬ν˜„λ˜μ–΄ 이슈 #169의 'ν‚€λ³΄λ“œ κΈ°κΈ° λŒ€μ‘' μš”κ΅¬μ‚¬ν•­μ„ μΆ©μ‘±ν•©λ‹ˆλ‹€.
Out of Scope Changes check βœ… Passed λͺ¨λ“  변경사항이 TargetDdaySettingView 파일의 ν‚€λ³΄λ“œ λŒ€μ‘ κΈ°λŠ₯ κ΅¬ν˜„μ— μ΄ˆμ μ„ λ§žμΆ”κ³  있으며 λ²”μœ„λ₯Ό λ²—μ–΄λ‚˜λŠ” λ‚΄μš©μ΄ μ—†μŠ΅λ‹ˆλ‹€.
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 fix/#157-keyboard

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

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

πŸ€– Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/TargetDdaySettingView.swift`:
- Around line 107-122: Replace the separate keyboardWillShow/keyboardWillHide
handlers with a single listener for
UIResponder.keyboardWillChangeFrameNotification; in that handler read
keyboardFrame from
notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] and the
animation duration from UIKeyboardAnimationDurationUserInfoKey, compute the
effective height by subtracting the view's safe area bottom inset (use your
geometry/proxy or a stored safeAreaInset variable) and set keyboardHeight inside
withAnimation(.easeOut(duration: duration)) so the change is synchronized; keep
the scrollTo("inputField", anchor: .center) call triggered when keyboardHeight >
0 but ensure it runs after the animated height change (same animation block or
DispatchQueue.main.asyncAfter matching duration) so the input field isn't
obscured.

Comment on lines +107 to 122
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { notification in
if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
keyboardHeight = keyboardFrame.height
}
}
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillHideNotification)) { _ in
withAnimation(.easeOut(duration: 0.25)) {
keyboardHeight = 0
}
}
.onChange(of: keyboardHeight) { _, newValue in
if newValue > 0 {
withAnimation(.easeOut(duration: 0.25)) {
proxy.scrollTo("inputField", anchor: .center)
}
}
Copy link

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:

find . -name "TargetDdaySettingView.swift" -type f 2>/dev/null

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 170


🏁 Script executed:

cat -n Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/TargetDdaySettingView.swift | sed -n '100,130p'

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1342


🏁 Script executed:

wc -l Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/TargetDdaySettingView.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 172


🏁 Script executed:

cat -n Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/TargetDdaySettingView.swift | head -50

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1826


🏁 Script executed:

rg "keyboardHeight|keyboardWill" Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/TargetDdaySettingView.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 576


🌐 Web query:

iOS UIResponder keyboard notifications keyboardWillChangeFrameNotification vs keyboardWillShow keyboardWillHide

πŸ’‘ Result:

Short answer

  • keyboardWillShow/keyboardDidShow and keyboardWillHide/keyboardDidHide are high-level "visibility" notifications (keyboard being shown or hidden). Use them when you only care about whether the keyboard is appearing or disappearing. [1][2]
  • keyboardWillChangeFrame/keyboardDidChangeFrame fire whenever the keyboard’s frame is about to change (or has changed) β€” that covers showing/hiding plus frame moves: size changes, language/layout switch, docking/undocking, split keyboard, inputAccessory changes, user dragging the keyboard, etc. Use these when you need the keyboard’s actual frame/height or to animate UI with the keyboard. [3][1]

Practical notes

  • The change-frame notifications include userInfo keys you’ll typically need: UIKeyboardFrameBeginUserInfoKey / UIKeyboardFrameEndUserInfoKey, UIKeyboardAnimationDurationUserInfoKey and UIKeyboardAnimationCurveUserInfoKey β€” read the end frame and animation info and animate your layout to match. [3]
  • On iPad the distinction matters more (docking/undocking and dragging can change frame without a simple show/hide). [3]
  • Many apps subscribe to keyboardWillChangeFrameNotification (and keyboardWillHide) as a robust way to adjust insets/constraints; some guard against spurious show/hide notifications by tracking a keyboardShowing flag. [3][2]

Sources

  1. Apple Developer: UIResponder.keyboardWillShow / keyboardWillHide pages. [1][2]
  2. Explanation and examples (UIKeyboard notifications, including keyboardWillChangeFrame): apeth.com and community threads. [3]

🌐 Web query:

iOS keyboard frame changes rotation orientation UIResponder notifications

πŸ’‘ Result:

Short summary / recipe

  • Observe UIResponder.keyboardWillChangeFrameNotification (and keyboardDidChangeFrameNotification if you need the final state). Use WillChangeFrame to animate in sync with the keyboard. [1][2]

  • Read the end frame from notification.userInfo[UIResponder.keyboardFrameEndUserInfoKey] (CGRect wrapped in NSValue). These frames are in screen coordinates and may not reflect your view’s orientation, so convert into your view/window coordinates before using: e.g. let endFrameInView = view.convert(keyboardEndFrame, from: nil) or window?.convert(...). Also check UIKeyboardIsLocalUserInfoKey to ignore another-app keyboards. [2][3]

  • Match the keyboard animation: read UIKeyboardAnimationDurationUserInfoKey and UIKeyboardAnimationCurveUserInfoKey from userInfo and animate your layout changes with the same duration/curve (or use UIView.animate with options: animationCurve << 16 mapping, or use UIViewPropertyAnimator). That keeps movement smooth during rotation. [1][3]

  • Handle rotation edge cases:

    • Rotation can cause keyboard frame changes (keyboardWillChangeFrame fires) rather than separate show/hide events; rely on endFrame to decide whether keyboard is visible (endFrame.origin.y >= UIScreen.main.bounds.height => hidden). [2]
    • On iPad and with floating/split keyboards or external keyboards, frames/behavior differ β€” prefer adjusting safeAreaInsets or bottom constraints instead of moving the whole view. [1][3]

Minimal example (Swift):

  • add observer for keyboardWillChangeFrameNotification
  • in handler:
    • guard let frame = (userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue
    • let frameInView = view.convert(frame, from: nil)
    • let duration = userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? TimeInterval ?? 0.25
    • let curve = (userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] as? Int) ?? 0
    • update bottom constraint = max(0, view.bounds.maxY - frameInView.minY)
    • animate layoutIfNeeded with duration and matching curve.

References

  • Apple UIResponder keyboard notifications (docs). [1]
  • Keyboard frame keys & screen-coordinate conversion discussion (StackOverflow / Managing the Keyboard). [2]
  • Practical guides / examples showing convertRect, animation matching and iPad considerations. [3]

If you want, I can paste a ready-to-use Swift handler class using these practices.


🌐 Web query:

iOS keyboard safe area inset calculation UIScreen bounds keyboardFrameEndUserInfoKey

πŸ’‘ Result:

Short answer β€” use the keyboard’s end frame in the keyboard’s coordinate space and convert it into your view’s coordinate space, then take the intersection height with your view bounds (that intersection is the keyboard overlap / safe-area bottom inset to apply). This avoids orientation/rotation and home‑indicator double-counting.

Recommended Swift pattern (concise):

  • Observe UIResponder.keyboardWillChangeFrameNotification / .keyboardDidChangeFrame.
  • From notification: get the CGRect and the UIScreen (notification.object on iOS 16.1+).
  • Convert the keyboard rect into your view’s coordinate space using the screen’s coordinateSpace (or window conversion).
  • Compute intersection with view.bounds; use intersection.height as the inset.

Example:

let info = notification.userInfo!
let endFrame = (info[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
if let screen = notification.object as? UIScreen {
let converted = screen.coordinateSpace.convert(endFrame, to: view)
let overlap = view.bounds.intersection(converted)
let bottomInset = overlap.isNull ? 0 : overlap.height
// apply bottomInset (or animate constraint using animation info from userInfo)
}

Notes:

  • If you instead take keyboard height directly, subtract window.safeAreaInsets.bottom to avoid adding the home‑indicator area twice.

ν‚€λ³΄λ“œ ν”„λ ˆμž„ λ³€κ²½(νšŒμ „/νƒ€μž… μ „ν™˜)에 높이가 κ°±μ‹ λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

keyboardWillShow/Hide μ•Œλ¦Όλ§Œ μ‚¬μš©ν•˜λ©΄ ν‚€λ³΄λ“œ νšŒμ „, μž…λ ₯κΈ° νƒ€μž… λ³€κ²½, ν‚€λ³΄λ“œ 높이 λ³€ν™” μ€‘μ—λŠ” μ—…λ°μ΄νŠΈλ˜μ§€ μ•Šμ•„ μž…λ ₯창이 κ°€λ €μ§ˆ 수 μžˆμŠ΅λ‹ˆλ‹€. keyboardWillChangeFrameNotification으둜 ν†΅ν•©ν•˜κ³ , μ•Œλ¦Όμ˜ UIKeyboardAnimationDurationUserInfoKeyλ₯Ό μ‚¬μš©ν•΄ μ• λ‹ˆλ©”μ΄μ…˜μ„ λ™κΈ°ν™”ν•˜λ©°, μ•ˆμ „ μ˜μ—­ 인셋 차감을 κ³ λ €ν•΄ μ£Όμ„Έμš”.

πŸ”§ κ°œμ„  μ œμ•ˆ
-            .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { notification in
-                if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
-                    keyboardHeight = keyboardFrame.height
-                }
-            }
-            .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillHideNotification)) { _ in
-                withAnimation(.easeOut(duration: 0.25)) {
-                    keyboardHeight = 0
-                }
-            }
+            .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillChangeFrameNotification)) { notification in
+                guard
+                    let info = notification.userInfo,
+                    let keyboardFrame = info[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect,
+                    let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double
+                else { return }
+                let screenHeight = UIScreen.main.bounds.height
+                let height = max(0, screenHeight - keyboardFrame.minY)
+                withAnimation(.easeOut(duration: duration)) {
+                    keyboardHeight = height
+                }
+            }
πŸ“ 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
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { notification in
if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
keyboardHeight = keyboardFrame.height
}
}
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillHideNotification)) { _ in
withAnimation(.easeOut(duration: 0.25)) {
keyboardHeight = 0
}
}
.onChange(of: keyboardHeight) { _, newValue in
if newValue > 0 {
withAnimation(.easeOut(duration: 0.25)) {
proxy.scrollTo("inputField", anchor: .center)
}
}
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillChangeFrameNotification)) { notification in
guard
let info = notification.userInfo,
let keyboardFrame = info[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect,
let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double
else { return }
let screenHeight = UIScreen.main.bounds.height
let height = max(0, screenHeight - keyboardFrame.minY)
withAnimation(.easeOut(duration: duration)) {
keyboardHeight = height
}
}
.onChange(of: keyboardHeight) { _, newValue in
if newValue > 0 {
withAnimation(.easeOut(duration: 0.25)) {
proxy.scrollTo("inputField", anchor: .center)
}
}
πŸ€– Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/TargetDdaySettingView.swift`
around lines 107 - 122, Replace the separate keyboardWillShow/keyboardWillHide
handlers with a single listener for
UIResponder.keyboardWillChangeFrameNotification; in that handler read
keyboardFrame from
notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] and the
animation duration from UIKeyboardAnimationDurationUserInfoKey, compute the
effective height by subtracting the view's safe area bottom inset (use your
geometry/proxy or a stored safeAreaInset variable) and set keyboardHeight inside
withAnimation(.easeOut(duration: duration)) so the change is synchronized; keep
the scrollTo("inputField", anchor: .center) call triggered when keyboardHeight >
0 but ensure it runs after the animated height change (same animation block or
DispatchQueue.main.asyncAfter matching duration) so the input field isn't
obscured.

Copy link
Contributor

@y-eonee y-eonee 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 +107 to +121
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { notification in
if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
keyboardHeight = keyboardFrame.height
}
}
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillHideNotification)) { _ in
withAnimation(.easeOut(duration: 0.25)) {
keyboardHeight = 0
}
}
.onChange(of: keyboardHeight) { _, newValue in
if newValue > 0 {
withAnimation(.easeOut(duration: 0.25)) {
proxy.scrollTo("inputField", anchor: .center)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

μ™€μš°κ΅Ώ μˆ˜κ³ ν•˜μ…¨μŠ΅λ‹ˆλ‹€

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
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.

κ΅¬μš°μš°μ›ƒ! μˆ˜κ³ ν–ˆμ–΄μš© μ˜€ν‘Έν‘Έ!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix 버그 μˆ˜μ • μž¬μ„ πŸ»

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] ν‚€λ³΄λ“œ κΈ°κΈ° λŒ€μ‘

5 participants