@@ -20,15 +20,17 @@ public struct TossTabView: View {
20
20
let content : [ any TossTabItemViewProtocol ]
21
21
22
22
public init < C0: TossTabItemViewProtocol ,
23
- C1: TossTabItemViewProtocol > ( @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 ) > )
23
+ C1: TossTabItemViewProtocol > ( haptic: UIImpactFeedbackGenerator . FeedbackStyle ? = . light,
24
+ @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 ) > )
24
25
{
25
26
let cv = content ( ) . value
26
27
self . content = [ cv. 0 , cv. 1 ]
27
28
}
28
29
29
30
public init < C0: TossTabItemViewProtocol ,
30
31
C1: TossTabItemViewProtocol ,
31
- C2: TossTabItemViewProtocol > ( @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 , C2 ) > )
32
+ C2: TossTabItemViewProtocol > ( haptic: UIImpactFeedbackGenerator . FeedbackStyle ? = . light,
33
+ @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 , C2 ) > )
32
34
{
33
35
let cv = content ( ) . value
34
36
self . content = [ cv. 0 , cv. 1 , cv. 2 ]
@@ -37,7 +39,8 @@ public struct TossTabView: View {
37
39
public init < C0: TossTabItemViewProtocol ,
38
40
C1: TossTabItemViewProtocol ,
39
41
C2: TossTabItemViewProtocol ,
40
- C3: TossTabItemViewProtocol > ( @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 , C2 , C3 ) > )
42
+ C3: TossTabItemViewProtocol > ( haptic: UIImpactFeedbackGenerator . FeedbackStyle ? = . light,
43
+ @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 , C2 , C3 ) > )
41
44
{
42
45
let cv = content ( ) . value
43
46
self . content = [ cv. 0 , cv. 1 , cv. 2 , cv. 3 ]
@@ -47,7 +50,8 @@ public struct TossTabView: View {
47
50
C1: TossTabItemViewProtocol ,
48
51
C2: TossTabItemViewProtocol ,
49
52
C3: TossTabItemViewProtocol ,
50
- C4: TossTabItemViewProtocol > ( @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 , C2 , C3 , C4 ) > )
53
+ C4: TossTabItemViewProtocol > ( haptic: UIImpactFeedbackGenerator . FeedbackStyle ? = . light,
54
+ @ViewBuilder content: @escaping ( ) -> TupleView < ( C0 , C1 , C2 , C3 , C4 ) > )
51
55
{
52
56
let cv = content ( ) . value
53
57
self . content = [ cv. 0 , cv. 1 , cv. 2 , cv. 3 , cv. 4 ]
@@ -77,7 +81,9 @@ public struct TossTabView: View {
77
81
HStack {
78
82
Spacer ( )
79
83
ForEach ( 0 ..< content. count, id: \. self) { idx in
80
- TossTabViewButton ( content [ idx] . title, content [ idx] . image, idx == selected) {
84
+ TossTabViewButton ( content [ idx] . title,
85
+ content [ idx] . image,
86
+ idx == selected) {
81
87
if selected != idx {
82
88
withAnimation ( . easeInOut( duration: 0.2 ) ) {
83
89
selected = idx
0 commit comments