Skip to content

[#285] iOS 18에서 adaptiveButtonStyle가 일부 잘려 보이는 현상을 해결한다#291

Merged
opficdev merged 1 commit intodevelopfrom
ui/#285-adaptiveButtonStyle
Mar 17, 2026
Merged

[#285] iOS 18에서 adaptiveButtonStyle가 일부 잘려 보이는 현상을 해결한다#291
opficdev merged 1 commit intodevelopfrom
ui/#285-adaptiveButtonStyle

Conversation

@opficdev
Copy link
Owner

@opficdev opficdev self-assigned this Mar 17, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 iOS 18에서 adaptiveButtonStyle이 올바르게 렌더링되지 않아 일부가 잘려 보이는 문제를 해결합니다. adaptiveButtonStyle 함수의 shape 매개변수 타입을 InsettableShape로 구체화하고, 배경 및 테두리 렌더링 로직을 strokeBorder를 사용하여 개선함으로써, 다양한 도형의 버튼 스타일이 모든 iOS 버전에서 일관되고 정확하게 표시되도록 보장합니다.

Highlights

  • adaptiveButtonStyle 함수 시그니처 변경: adaptiveButtonStyle 함수의 shape 매개변수가 some Shape에서 S: InsettableShape로 변경되었고, 기본값이 Capsule()로 지정되었습니다. 이는 iOS 18에서 발생할 수 있는 렌더링 문제를 해결하기 위함입니다.
  • adaptiveButtonStyle 배경 렌더링 로직 개선: 배경을 그리는 로직이 Group과 조건부 fill 대신 삼항 연산자를 사용하여 간소화되었으며, overlay와 stroke 대신 strokeBorder를 사용하여 테두리가 도형 내부에 그려지도록 변경되었습니다. 이는 iOS 18에서 버튼 스타일이 잘려 보이는 현상을 해결하는 데 도움이 됩니다.
Changelog
  • DevLog/UI/Extension/View+.swift
    • adaptiveButtonStyle 함수의 shape 매개변수 타입을 InsettableShape로 변경하고 기본값을 Capsule()로 지정했습니다.
    • adaptiveButtonStyle 내에서 배경 채우기 로직을 삼항 연산자로 간소화했습니다.
    • 테두리 렌더링을 stroke에서 strokeBorder로 변경하여 테두리가 도형 내부에 그려지도록 수정했습니다.
Activity
  • 이 풀 리퀘스트는 이슈 #285를 해결하기 위해 생성되었습니다.
  • 현재까지 추가적인 리뷰 활동이나 코멘트는 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@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

이 PR은 iOS 18에서 adaptiveButtonStyle의 테두리가 잘려 보이는 문제를 해결하기 위해 .stroke.strokeBorder로 변경하는 것을 목표로 합니다. 이를 위해 함수의 shape 파라미터 타입을 some Shape에서 제네릭 InsettableShape으로 변경했습니다. 리뷰 결과, 제네릭 함수 시그니처의 기본값 설정과 .strokeBorder 적용 방식에서 컴파일 오류를 유발할 수 있는 두 가지 심각한 문제가 발견되어 수정을 제안했습니다.

Comment on lines +96 to +99
func adaptiveButtonStyle<S: InsettableShape>(
shape: S = Capsule(),
color: Color = .clear
) -> some View {
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

제네릭 타입 S에 대해 Capsule()을 기본값으로 설정할 수 없습니다. S는 어떤 InsettableShape이든 될 수 있기 때문에 컴파일러가 타입을 추론할 수 없어 오류가 발생합니다.

가장 직접적인 수정은 아래와 같이 기본값을 제거하는 것입니다. 하지만 이 경우 기존 호출 코드에 영향을 줄 수 있습니다.

더 나은 해결책은 기본값을 사용하는 오버로드 함수를 추가하는 것입니다:

@ViewBuilder
func adaptiveButtonStyle(color: Color = .clear) -> some View {
    self.adaptiveButtonStyle(shape: Capsule(), color: color)
}

// 그리고 이 함수의 시그니처를 아래와 같이 변경합니다.
@ViewBuilder
func adaptiveButtonStyle<S: InsettableShape>(
    shape: S,
    color: Color = .clear
) -> some View {
    // ... implementation
}
Suggested change
func adaptiveButtonStyle<S: InsettableShape>(
shape: S = Capsule(),
color: Color = .clear
) -> some View {
func adaptiveButtonStyle<S: InsettableShape>(
shape: S,
color: Color = .clear
) -> some View {

Comment on lines +109 to +111
shape
.fill(color == .clear ? Color(.systemGray5) : color)
.strokeBorder(Color.white.opacity(0.2), lineWidth: 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

.fill 메서드는 some View를 반환하므로 InsettableShape의 메서드인 .strokeBorder를 직접 체이닝할 수 없습니다. 이 코드는 컴파일되지 않습니다.

배경과 테두리를 함께 적용하려면 overlay 수정자를 사용하는 것이 좋습니다. 이렇게 하면 코드를 간결하게 유지하면서도 올바르게 테두리를 그릴 수 있습니다.

Suggested change
shape
.fill(color == .clear ? Color(.systemGray5) : color)
.strokeBorder(Color.white.opacity(0.2), lineWidth: 1)
shape
.fill(color == .clear ? Color(.systemGray5) : color)
.overlay(shape.strokeBorder(Color.white.opacity(0.2), lineWidth: 1))

@opficdev opficdev merged commit e5d6499 into develop Mar 17, 2026
2 checks passed
@opficdev opficdev deleted the ui/#285-adaptiveButtonStyle branch March 17, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS 18에서 adaptiveButtonStyle가 일부 잘려 보이는 현상을 해결한다

1 participant