Skip to content

Commit d88929e

Browse files
committed
Update example
1 parent dd0cd27 commit d88929e

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/Shared/ExamplesView.swift

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import _SwiftUINavigationState
12
import SwiftUI
23
import ToastUI
34

@@ -8,46 +9,56 @@ struct ExamplesView: View {
89
VStack(spacing: 12) {
910
Button("Regular toast") {
1011
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+
)
1518
)
1619
}
1720

1821
Button("Failure toast") {
1922
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+
)
2429
)
2530
}
2631

2732
Button("Warning toast") {
2833
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+
)
3340
)
3441
}
3542

3643
Button("Info toast") {
3744
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+
)
4251
)
4352
}
4453

4554
Button("Success toast") {
4655
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+
)
5162
)
5263
}
5364
}

0 commit comments

Comments
 (0)