Skip to content

Commit dd0cd27

Browse files
committed
Add ImageState
1 parent 1a2a394 commit dd0cd27

File tree

10 files changed

+407
-147
lines changed

10 files changed

+407
-147
lines changed

.swiftformat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--swiftversion 5.7
2+
--binarygrouping none
3+
--decimalgrouping none
4+
--hexgrouping none
5+
--indent 2
6+
--octalgrouping none
7+
--semicolons never
8+
--wraparguments before-first
9+
--wrapcollections before-first
10+
--wrapparameters before-first
11+
--extensionacl on-declarations
12+
--maxwidth 100

Examples/Shared/ExamplesApp.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import SwiftUI
99

1010
@main
1111
struct ExamplesApp: App {
12-
var body: some Scene {
13-
WindowGroup {
14-
ExamplesView()
15-
}
12+
var body: some Scene {
13+
WindowGroup {
14+
ExamplesView()
1615
}
16+
}
1717
}

Examples/Shared/ExamplesView.swift

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
import ToastUI
21
import SwiftUI
2+
import ToastUI
33

44
struct ExamplesView: View {
5-
@State var toast: ToastView?
5+
@State var toast: ToastView?
66

7-
var body: some View {
8-
VStack(spacing: 12) {
9-
Button("Regular toast") {
10-
toast = ToastView(
11-
style: .regular,
12-
icon: Image(systemName: "exclamationmark.square"),
13-
title: "Regular toast",
14-
subtitle: "This is the subtitle."
15-
)
16-
}
7+
var body: some View {
8+
VStack(spacing: 12) {
9+
Button("Regular toast") {
10+
toast = ToastView(
11+
style: .regular,
12+
icon: Image(systemName: "exclamationmark.square"),
13+
title: "Regular toast",
14+
subtitle: "This is the subtitle."
15+
)
16+
}
1717

18-
Button("Failure toast") {
19-
toast = ToastView(
20-
style: .failure,
21-
icon: Image(systemName: "exclamationmark.square"),
22-
title: "Failure toast",
23-
subtitle: "This is the subtitle."
24-
)
25-
}
18+
Button("Failure toast") {
19+
toast = ToastView(
20+
style: .failure,
21+
icon: Image(systemName: "exclamationmark.square"),
22+
title: "Failure toast",
23+
subtitle: "This is the subtitle."
24+
)
25+
}
2626

27-
Button("Warning toast") {
28-
toast = ToastView(
29-
style: .warning,
30-
icon: Image(systemName: "exclamationmark.square"),
31-
title: "Warning toast",
32-
subtitle: "This is the subtitle."
33-
)
34-
}
27+
Button("Warning toast") {
28+
toast = ToastView(
29+
style: .warning,
30+
icon: Image(systemName: "exclamationmark.square"),
31+
title: "Warning toast",
32+
subtitle: "This is the subtitle."
33+
)
34+
}
3535

36-
Button("Info toast") {
37-
toast = ToastView(
38-
style: .info,
39-
icon: Image(systemName: "exclamationmark.square"),
40-
title: "Info toast",
41-
subtitle: "This is the subtitle."
42-
)
43-
}
36+
Button("Info toast") {
37+
toast = ToastView(
38+
style: .info,
39+
icon: Image(systemName: "exclamationmark.square"),
40+
title: "Info toast",
41+
subtitle: "This is the subtitle."
42+
)
43+
}
4444

45-
Button("Success toast") {
46-
toast = ToastView(
47-
style: .success,
48-
icon: Image(systemName: "exclamationmark.square"),
49-
title: "Success toast",
50-
subtitle: "This is the subtitle."
51-
)
52-
}
53-
}
54-
.buttonStyle(.bordered)
55-
.padding(12)
56-
.toast(item: $toast) { $0 }
45+
Button("Success toast") {
46+
toast = ToastView(
47+
style: .success,
48+
icon: Image(systemName: "exclamationmark.square"),
49+
title: "Success toast",
50+
subtitle: "This is the subtitle."
51+
)
52+
}
5753
}
54+
.buttonStyle(.bordered)
55+
.padding(12)
56+
.toast(item: $toast) { $0 }
57+
}
5858
}
5959

6060
struct ContentView_Previews: PreviewProvider {
61-
static var previews: some View {
62-
ExamplesView()
63-
}
61+
static var previews: some View {
62+
ExamplesView()
63+
}
6464
}

Package.resolved

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

Package.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ let package = Package(
1313
products: [
1414
.library(
1515
name: "ToastUI",
16-
targets: ["ToastUI"])
16+
targets: ["ToastUI"]
17+
),
1718
],
1819
dependencies: [
19-
.package(url: "https://github.com/pointfreeco/swiftui-navigation", from: "0.1.0")
20+
.package(url: "https://github.com/pointfreeco/swiftui-navigation", from: "0.4.5"),
2021
],
2122
targets: [
2223
.target(
2324
name: "ToastUI",
2425
dependencies: [
25-
.product(name: "SwiftUINavigation", package: "swiftui-navigation")
26-
]),
26+
.product(name: "SwiftUINavigation", package: "swiftui-navigation"),
27+
.product(name: "_SwiftUINavigationState", package: "swiftui-navigation"),
28+
]
29+
),
2730
.testTarget(
2831
name: "ToastUITests",
29-
dependencies: ["ToastUI"]),
32+
dependencies: ["ToastUI"]
33+
),
3034
]
3135
)

0 commit comments

Comments
 (0)