Skip to content

Commit e5d6499

Browse files
authored
[#285] iOS 18에서 adaptiveButtonStyle가 일부 잘려 보이는 현상을 해결한다 (#291)
- fix: strokeBorder로 처리하여 해결
1 parent f20d1a6 commit e5d6499

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

DevLog/UI/Extension/View+.swift

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ private struct ScrollViewOffsetTracker: UIViewRepresentable {
9393

9494
extension View {
9595
@ViewBuilder
96-
func adaptiveButtonStyle(
97-
shape: some Shape = .capsule,
98-
color: Color = .clear)
99-
-> some View {
96+
func adaptiveButtonStyle<S: InsettableShape>(
97+
shape: S = Capsule(),
98+
color: Color = .clear
99+
) -> some View {
100100
if #available(iOS 26.0, *) {
101101
self.foregroundStyle(Color(.label))
102102
.padding(8)
@@ -106,19 +106,9 @@ extension View {
106106
self.foregroundStyle(Color(.label))
107107
.padding(8)
108108
.background {
109-
Group {
110-
if color == .clear {
111-
shape
112-
.fill(Color(.systemGray5))
113-
} else {
114-
shape
115-
.fill(color)
116-
}
117-
}
118-
.overlay {
119-
shape
120-
.stroke(Color.white.opacity(0.2), lineWidth: 1)
121-
}
109+
shape
110+
.fill(color == .clear ? Color(.systemGray5) : color)
111+
.strokeBorder(Color.white.opacity(0.2), lineWidth: 1)
122112
}
123113
}
124114
}

0 commit comments

Comments
 (0)