-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathView+.swift
More file actions
40 lines (38 loc) · 1.04 KB
/
View+.swift
File metadata and controls
40 lines (38 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// View+.swift
// DevLog
//
// Created by 최윤진 on 11/22/25.
//
import SwiftUI
extension View {
@ViewBuilder
func adaptiveButtonStyle(
shape: some Shape = .capsule,
color: Color = .clear)
-> some View {
if #available(iOS 26.0, *) {
self.foregroundStyle(Color(.label))
.padding(8)
.glassEffect(.regular.tint(color), in: shape)
} else {
self.foregroundStyle(Color(.label))
.padding(8)
.background {
Group {
if color == .clear {
shape
.fill(.ultraThinMaterial)
} else {
shape
.fill(color)
}
}
.overlay {
shape
.stroke(Color.white.opacity(0.2), lineWidth: 1)
}
}
}
}
}