1
+ import _SwiftUINavigationState
1
2
import SwiftUI
2
3
import ToastUI
3
4
@@ -8,46 +9,56 @@ struct ExamplesView: View {
8
9
VStack ( spacing: 12 ) {
9
10
Button ( " Regular toast " ) {
10
11
toast = ToastView (
11
- style: . regular,
12
- icon: Image ( systemName: " exclamationmark.square " ) ,
13
- title: " Regular toast " ,
14
- subtitle: " This is the subtitle. "
12
+ ToastState (
13
+ style: . regular,
14
+ icon: ImageState ( systemName: " exclamationmark.square " ) ,
15
+ title: TextState ( " Regular toast " ) ,
16
+ subtitle: TextState ( " This is the subtitle. " )
17
+ )
15
18
)
16
19
}
17
20
18
21
Button ( " Failure toast " ) {
19
22
toast = ToastView (
20
- style: . failure,
21
- icon: Image ( systemName: " exclamationmark.square " ) ,
22
- title: " Failure toast " ,
23
- subtitle: " This is the subtitle. "
23
+ ToastState (
24
+ style: . failure,
25
+ icon: ImageState ( systemName: " exclamationmark.square " ) ,
26
+ title: TextState ( " Failure toast " ) ,
27
+ subtitle: TextState ( " This is the subtitle. " )
28
+ )
24
29
)
25
30
}
26
31
27
32
Button ( " Warning toast " ) {
28
33
toast = ToastView (
29
- style: . warning,
30
- icon: Image ( systemName: " exclamationmark.square " ) ,
31
- title: " Warning toast " ,
32
- subtitle: " This is the subtitle. "
34
+ ToastState (
35
+ style: . warning,
36
+ icon: ImageState ( systemName: " exclamationmark.square " ) ,
37
+ title: TextState ( " Warning toast " ) ,
38
+ subtitle: TextState ( " This is the subtitle. " )
39
+ )
33
40
)
34
41
}
35
42
36
43
Button ( " Info toast " ) {
37
44
toast = ToastView (
38
- style: . info,
39
- icon: Image ( systemName: " exclamationmark.square " ) ,
40
- title: " Info toast " ,
41
- subtitle: " This is the subtitle. "
45
+ ToastState (
46
+ style: . info,
47
+ icon: ImageState ( systemName: " exclamationmark.square " ) ,
48
+ title: TextState ( " Info toast " ) ,
49
+ subtitle: TextState ( " This is the subtitle. " )
50
+ )
42
51
)
43
52
}
44
53
45
54
Button ( " Success toast " ) {
46
55
toast = ToastView (
47
- style: . success,
48
- icon: Image ( systemName: " exclamationmark.square " ) ,
49
- title: " Success toast " ,
50
- subtitle: " This is the subtitle. "
56
+ ToastState (
57
+ style: . success,
58
+ icon: ImageState ( systemName: " exclamationmark.square " ) ,
59
+ title: TextState ( " Success toast " ) ,
60
+ subtitle: TextState ( " This is the subtitle. " )
61
+ )
51
62
)
52
63
}
53
64
}
0 commit comments